With INNODB you can add to your query LOCK IN SHARE MODE;
so that other users can still read but not update untill the user that is editing is finished.
My current PDO function in PHP currently looks like:
//$this->db is a PDO connection to the MYSQL innodb database.
try
{
$this->db->beginTransaction();
$tmp = $this->db->prepare($query);
$tmp->execute($arr);
$this->last_id = $this->db->lastInsertId();
$this->db->commit();
return $this->last_id;
}
catch(PDOException $ex)
{
$this->db->rollBack();
return $ex->getMessage();
}
Is there an PDO driver function setting to set it in share mode? if so how? The only things I find have no answers to them and the documentation isn't really clear either. Or should I add it simply to the query string?