gpt4 book ai didi

php - db 获取数组 drupal 7

转载 作者:行者123 更新时间:2023-11-29 01:59:36 25 4
gpt4 key购买 nike

我遇到了从 drupal 6 到 7 网站的迁移问题。我是 PHP 和 MySQL 的初学者,我找不到解决问题的办法。

我正在努力处理的代码如下:

$sql = "select ID_Speler from TB_Spelers where uid = ".$id;
$row = db_fetch_array(db_query($sql));
$speler = $row['ID_Speler'];

我总是收到“调用未定义函数 db_​​fetch_array()”

非常感谢任何帮助。

最佳答案

在 Drupal 7 中使用它:

$query = db_select('field_data_field_order_no', 'fdfon');
$query->addField('fdfon', 'entity_id', 'nid');
$query->addField('fdfnt', 'field_notification_type_value', 'type');
$query->join('field_data_field_notification_type', 'fdfnt', 'fdfon.entity_id = fdfnt.entity_id AND (fdfon.bundle = :fdfon_bundle AND fdfnt.bundle = :fdfnt_bundle)', array(':fdfon_bundle' => "order_notification_type", ':fdfnt_bundle' => "order_notification_type"));
$query->condition('fdfon.field_order_no_value', $order_id)->orderBy('fdfnt.entity_id', 'asc');

$result = $query->execute();

while ($records = $result->fetchAssoc()) {
...
}

关于php - db 获取数组 drupal 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18728029/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com