PDO syntaxing

This commit is contained in:
Shish 2011-01-26 14:56:26 +00:00
parent 10d033b14b
commit a008a9e34e

View file

@ -245,9 +245,9 @@ class ImageIO extends SimpleExtension {
"hash"=>$image->hash, "ext"=>$image->ext, "width"=>$image->width, "height"=>$image->height, "source"=>$image->source
)
);
//$database->Execute("UPDATE users SET image_count = image_count+1 WHERE id = :id ", array("id"=>$user->id));
if($database->engine->name == "pgsql") {
$database->Execute("UPDATE users SET image_count = image_count+1 WHERE id = ? ", array($user->id));
$image->id = $database->get_one("SELECT id FROM images WHERE hash=?", array($image->hash));
$image->id = $database->get_one("SELECT id FROM images WHERE hash=:hash", array("hash"=>$image->hash));
}
else {
$image->id = $database->get_last_insert_id();