Somehow my execute statement says the object has no member "execute". What is wrong?
class EdlSqliteDb
{
const SQLITE_DRIVER = "sqlite:";
var $dbh;
var $qIndex = Array();
//
function EdlSqliteDb($dsn)
{
try
{
$this->dbh = new PDO(self::SQLITE_DRIVER . $dsn);
}
catch (PDOException $e)
{
echo "Error connecting: " . $e->getMessage() . ' ' . self::SQLITE_DRIVER . $dsn;
die();
}
return;
}
//
function addQ($index,$q)
{
$this->qIndex[$index] = $q;
}
//
function PrepareQ($index)
{
try
{
$stmt = $this->dbh->prepare($this->qIndex[$index]);
}
catch (PDOException $e)
{
echo "Db Prepare Error: " . $e->getMessage();
die();
}
return $stmt;
}
//
function DbExecutePrepared($index, $arrParameters)
{
$stmt = $this->PrepareQ($index);
if ($stmt->execute($arrParameters))
{
$row = $stmt->fetch();
return $row;
}
else
{
print "<p>dbquery(): database table update execute error</p>\n";
die();
}
}
}