duanputian5341 2009-11-06 03:17
浏览 10

将NSData通过PHP发送到MySQL的最佳方法是什么?

Ok I believe this must be a pretty common scenario. I need to send a NSData variable over a HTTP request through a PHP page which then subsequently stores it in MySQL. This will be retrieved later by some other HTTP call which then downloads it into a NSData again. What is the best way to do this?

Should I convert the NSData into some sort of string representation (base64 etc)? Should I store the data in MySQL as VARCHAR or Blob? The data length will not exceed the MySQL/HTTP limit.

  • 写回答

3条回答 默认 最新

  • dongmu5596 2009-11-06 03:24
    关注

    1st Suggestion: you can store it in a session in PHP e.g. $_SESSION['mytext'] = <NSDATA>; don't forget to session_start(); to retrieve your string.

    2nd Suggestion: you can store it in a XML FILE. That's if it supports XML

    3rd Suggestion: just call it back from MYSQL to be safe.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据