dswsl2016 2009-10-29 04:44
浏览 14
已采纳

如何在SQL表的列中存储多个值?

I am using PHP. I need to store the multiple values at a single column. The values are come from depending on the checkbox selected. I didnt use the array for checkbox name. What can I do?

  • 写回答

2条回答 默认 最新

  • dongwei6457 2009-10-29 04:59
    关注

    You just need to find a standard way to store the information as a longer string.

    So, for example, if you know '__' isn't going to show up in your data then you can store checkboxvalue__otherdata, but has risk.

    As alex mentioned, if you use json, http://json.org, then you will put information into this object and then save it as a string, but to be safe you should base64 encode it.

    Or you could store it in an xml file.

    If you were just saving 2 bytes, for example, then you could push them into an int, and then decode it later.

    Basically, just determine some way that works for you to store the type of data you want to store.

    If you have a signed into that is always less than 2G and greater than 0 then you could put the checkbox (0 or 1) into the first bit of an unsigned int.

    You didn't specify what the data you want to store is, so it is hard to give more detail.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度