is this code what im doing is correct..?
im using codeigniter framework of this one…engine use is iNNodb
db->simple_query('SET AUTOCOMMIT=0');
$lockquery = "LOCK TABLE costumer_prof WRITE";
$db->insert('costumer_prof',$valueAdded);
if($db->trans_status() === FALSE) //is this ok to used trans_status without trans_start or trans_begin..?
{
$db->trans_rollback()
return 1;
}
else
{
$db->trans_commit();
return 0;
}
$lockquery = "UNLOCK TABLE";
}
?>
am i implementing the right way to lock table or better to use
$lockquery = "LOCK TABLE costumer_prof IN SHARE MODE";
hope this thread is still active..i really appreciate for those who reply …i’ll acknowledge it:)