sqlite ERROR no such column
Posted
by Richard
on Stack Overflow
See other posts from Stack Overflow
or by Richard
Published on 2010-06-17T17:26:38Z
Indexed on
2010/06/17
17:33 UTC
Read the original article
Hit count: 365
Hi,
Does anyone here have some experience with this error?
Only If I use the WHERE clause, I get this error.
I use php PDO to get the results.
And this is my simple table
$sql = "CREATE TABLE samenvatting (
stem_id INTEGER PRIMARY KEY AUTOINCREMENT,
poll_id TEXT,
stem_waarde_id TEXT,
totaal INTEGER
)";
$crud->rawQuery($sql);
$poll_id = "somepoll";
$records = $crud->rawSelect('SELECT * FROM samenvatting WHERE poll_id=´.$poll_id);
pdo abstract class
public function conn()
{
isset($this->username);
isset($this->password);
if (!$this->db instanceof PDO)
{
$this->db = new PDO($this->dsn, $this->username, $this->password);
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
}
public function rawSelect($sql)
{
$this->conn();
return $this->db->query($sql);
}
Thanks, Richard
© Stack Overflow or respective owner