How to UPDATE the same mysql row from multiple scripts at the same time?

MisterTom

New Member
I am forking some php scripts and I need to update a mysql row to track some progress. I read that I should use InnoDB for this but I coulnd't find any complete example I can understand. A friend told me he uses this php code:\[code\]mysql_query("SET AUTOCOMMIT=0;");mysql_query("START TRANSACTION;");mysql_query("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;");// UPDATE QUERY HEREmysql_query("COMMIT;");mysql_query("UNLOCK TABLES;"); mysql_query("SET AUTOCOMMIT=1;");\[/code\]He told me he tried other methods but everything else than that code overloaded his server after some time.Does someone could tell me if this code will do what I need or if there's a better way to do it?
 
Back
Top