drupal模块中查询数据库并将结果存储在数组中
我的数据库中有一个名为 gsm_tariff
的表。基本上我只想运行一个简单的选择查询
"SELECT * FROM {gsm_tariff} WHERE Country='Afghanistan'"
并将结果存储在数组中。谁能帮我解决这个问题吗?我知道把代码和所有东西放在哪里;我只需要代码来执行查询并将结果存储在数组中。
I have a table in my database called gsm_tariff
. Basically I just want to run a simple select query
"SELECT * FROM {gsm_tariff} WHERE Country='Afghanistan'"
and store the results in an array. Can anyone help me with how to do this please? I know where to put the code and everything; I just need the code to do the query and store the results in an array.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,我不知道给定问题时您要引用的字段,但它将位于 $record 对象中。
Note that I don't know the field you want to reference given the question, but it would be in the $record object.