Page 1 of 1

checking if LOCK TABLES succeeded

Posted: Tue May 05, 2009 7:08 pm
by ElysianEagle
hi,

in my php code i need to execute the LOCK TABLES mysql query, but how do i check that it succeeded?

can i rely on just doing this:

if (mysql_query("LOCK TABLES myTable READ")) {...}

??

thanks!

Re: checking if LOCK TABLES succeeded

Posted: Tue May 05, 2009 7:14 pm
by Defiline
http://php.net/manual/en/function.mysql-query.php
For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error.
This means that you can use "if" statement.