Drupal 7:致命错误未定义db_fetch_object()

时间:2014-01-06 09:45:55

标签: php drupal-7

PHP致命错误:

Call to undefined function db_fetch_object() in /var/www/testsite/sites/all/modules/contrib/flashvideo/flashvideo.module on line 2092, in Drupal 7 when I upgarded my website from drupal 6 to 7.

查询是:

$sql = "SELECT fv.oid, f.filepath, fv.width, fv.height, f.fid FROM {flashvideo} fv
         LEFT JOIN {files} f ON f.fid = fv.fid
         LEFT JOIN {upload} u on u.fid = fv.fid
         WHERE $flashmime AND (fv.status = %d) AND (fv.nid = %d) AND (fv.video_index =   %d)$vid_query";
  $video_file = db_fetch_object(db_query($sql, FLASHVIDEO_STATUS_CONVERTED, $nid, $index, $node->vid));

我该怎么写查询?我是否需要更改查询?

1 个答案:

答案 0 :(得分:3)

我猜db_fetch_object来自drupal 7的deprecated

相反尝试,

db_query($sql, FLASHVIDEO_STATUS_CONVERTED, $nid, $index, $node->vid)->fetch();