我剛剛得到一個查詢鱈魚:「?」這是什麼意思?在SQL查詢?
SELECT o.id,o.sort_order,od.object FROM i_objects o, i_objects_description od
WHERE o.id=od.objects_id AND o.object_status = ? AND od.languages_id = ?
ORDER BY o.sort_order ASC
我想弄清楚哪些呢在這個查詢中的意思 如果我運行此查詢,它給了我這個錯誤:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?
進出口使用PEAR,這是我的函數:
function getArrayObjects($language_id)
{
$q = 'SELECT o.id,o.sort_order,od.object FROM ' . TABLE_OBJECTS . ' o, ' . TABLE_OBJECTS_DESCRIPTION . ' od ';
$q.= 'WHERE o.id=od.objects_id AND o.object_status = ? AND od.languages_id = ? ';
$q.= 'ORDER BY o.sort_order ASC';
$sth = $this->_db->prepare($q);
$res = $sth->execute(array('active', $language_id));
//var_dump($res);echo "<br>";echo "<br>";echo "<br>";
$objects = array();
while($row = $res->fetchRow())
{
$objects[$row['id']] = $row;
}
return $objects;
}
@Sergio Tulentsev你會更具體嗎? – Chester