Hi gurus,
I am quite new to MYSQL. I would like to allow concurrent access to my leave application.
Not sure how to the code is to be done but according to some MySql docs...is this correct?
$db = mysql_connect("localhost","root","root");
if(!$db){
print("Could not connect to database. Please try again later.");
exit;
}
mysql_select_db("lv_mgmt_sys");
$query = "SET AUTOCOMMIT = 0";
mysql_query($query);
$query = "START TRANSACTION";
mysql_query($query);
$query = "SELECT * FROM superv_details WHERE (emp_id='$emp_number')";
mysql_query($db_query);
$query = "COMMIT";
mysql_query($query);
$numrows = mysql_num_rows($result);
if($numrows > 0){
$query = "UPDATE superv_details SET superv_name='$fullname',dept_code='$department',emp_status='$emp_status',email='$email_addr' WHERE emp_id='$emp_number'";
}
mysql_query($query);
$query = "COMMIT";
mysql_query($query);
Can someone give me an example of how it should be done?
Thanks