doulao3905 2013-11-25 13:49
浏览 61
已采纳

使用buddypress在SQL db中保存复选框

I'm using buddypress on my wordpress site and want to store a checkbox value to the custom profile fields. Users need to be able to check the checkbox when registering for the site. I know how to add a value to the xprofile field, I just don't know what the format of the value should be.

When looking into phpMyAdmin I see the values for the checkbox are: 'a:1:{i:0;s:2:"True";}' for true, and 'a:0:{}' for false.

What does this all mean? Are these wp / bp specific? Should I just write these exact values into the db for everyone?

  • 写回答

1条回答 默认 最新

  • dongqijuan3786 2013-11-25 15:46
    关注

    Did you add the checkbox via the DashBoard > Users > Profile Fields ? If you add it to the 'Base' group, it should show up on the register form. And BP will handle the saving for you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 qgcomp混合物线性模型分析的代码出现错误:Model aliasing occurred
  • ¥100 已有python代码,要求做成可执行程序,程序设计内容不多
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助
  • ¥15 STM32控制MAX7219问题求解答
  • ¥20 在本地部署CHATRWKV时遇到了AttributeError: 'str' object has no attribute 'requires_grad'