我在下面的代码中遇到mysql_fetch_object
的问题。请帮我解决。
$query .= 'order by ts_uploaded DESC' ;
$result = mysql_query($query);
// format the return data, allows us to create key for thumbname
$items = array();
while ($row = mysql_fetch_object($result)) {
$items[$row->id]['id'] = $row->id;
$items[$row->id]['filename'] = $row->filename;
$items[$row->id]['status'] = $row->status;
$items[$row->id]['format'] = $row->format;
$items[$row->id]['title'] = $row->title;
$items[$row->id]['duration'] = $row->duration;
$items[$row->id]['thumbnail'] = getThumbname($row->filename);
$items[$row->id]['width'] = $row->width;
$items[$row->id]['height'] = $row->height;
}
return $items;
}
答案 0 :(得分:0)
您的mysql查询中有错误。尝试做:
echo $query;
echo mysql_error();
在mysql_query语句之后,看看有什么问题。
答案 1 :(得分:0)