0
我花了2個小時只是選擇語句。zend select字符串語句
我在做什麼錯?
public function fetchSpecific($moderatorid = 1)
{
$resultSet = $this->getDbTable()->fetchAll("moderatorid = ".$moderatorid);
$entries = array();
foreach ($resultSet as $row) {
$entry = new Application_Model_Network();
$entry->setId($row->id)
->setName($row->name)
->setModeratorId($row->moderatorid);
$entries[] = $entry;
}
return $entries;
}
這是所有關於這一行:
$resultSet = $this->getDbTable()->fetchAll("moderatorid = ".$moderatorid);
它給我一個錯誤喜歡這樣的:
Message: SQLSTATE[42000]: Syntax error or access violation: 1064 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 ')' at line 1
尼斯解釋。 +1 – RockyFord 2012-02-28 04:59:30
這救了我的生命.. – Proto 2012-02-28 07:51:52
非常好,很高興幫助! – drew010 2012-02-28 08:06:15