checking if LOCK TABLES succeeded

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ElysianEagle
Forum Newbie
Posts: 1
Joined: Tue May 05, 2009 7:06 pm

checking if LOCK TABLES succeeded

Post 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!
Defiline
Forum Commoner
Posts: 59
Joined: Tue May 05, 2009 5:34 pm

Re: checking if LOCK TABLES succeeded

Post 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.
Post Reply