0

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:)

Edited by zhinokin: n/a

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by JRM
0

tnx JRM for the reply..:)..

even the i only use 1 table to lock..ill do an alias on it..?..am i right...?..

0

seems so. otherwise it gets complicated.
Please mark as soled if you got it working
thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.