In my application I'm using SQLite3, and right now I'm trying to get DELETE to work. The code below seems fine for me, and I've checked that $producerId holds the Id, which of course exists in the database.
However, I get false back as a result from the query execution, and the posts doesn't get deleted.
What am I doing wrong?
public function deleteProducer($producerId) {
$sql = "DELETE FROM 'producers' WHERE 'producerid' = $producerId";
$result = $this->m_db->exec($sql);
return $result; // <- 0 (fails)
}
database structure:
Table: producers
Fields: id(INTEGER PRIMARY KEY), producerid(INT), name(TEXT), address(TEXT), zipcode(INT), town(TEXT), url(TEXT), imgurl(TEXT)