dongqian1925 2015-01-15 07:52
浏览 60

将SQL /文件结构数据下载到iPad应用程序的最有效方法是什么?

Currently i have:

A server that has mySQL installed and accessed by PHP scripts. All data is in SQL database including photos.

What i want to do is move the photos out the database and into their own file structure (that bit i can do) what i don't know is how to get all the string data out the database and photos into one return message, potentially I'm talking a fe hundred rows of data.

Currently i perform sql query and have to do the following

while($row = mysql_fetch_array($result))
    {
        $encodepic = base64_encode($row['IMAGE']);
        $posts[] = array($row['ID'],$row['COL1'], $row['COL2'], $row['COL3'], $row['COL4'], $encodepic, $row['COL5'], $row['COL6'], $row['COL7']);
    }
    echo json_encode($posts);

If i change the $row['IMAGE'] for the file (obviously read it first, won't that make system really slow?

Is there a better way full stop of doing what I'm trying to do

Also for code tidiness i want to send the dictionary down so other end (unless this makes system inefficient)

Thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
    • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
    • ¥15 Centos / PETSc / PETGEM
    • ¥15 centos7.9 IPv6端口telnet和端口监控问题
    • ¥120 计算机网络的新校区组网设计
    • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 海浪数据 南海地区海况数据,波浪数据
    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等