Hi people,
I dont know why but am stuck trying to debug this problem. I keep
getting error number 1100 (Table 'jobs' was not locked with LOCK TABLES)
from PHP when i try querying a mysql database. It has me stumped because
I am using the LOCK TABLES statement when locking the tables...but maybe
there is something wrong with my code that i cant see...

Here is the function i use to lock/unlock the table(s). I call this
function before querying the database. $dblink is the MySQL Link
Resource, $table is the table to lock, $grant describes how it should be
locked (READ/WRITE), if $table or $grant are null then it assumes the
tables are to be unlocked:

function lock($dblink,$table,$grant){
        //function to lock/unlock tables
        if(($table == null) or ($grant == null)){
                        $unlock = @mysql_query("UNLOCK TABLES",$dblink);
                return  $unlock;
                $lock = @mysql_query("LOCK TABLES " . $table . " " . $grant,$dblink);
                return $lock;

Any ideas?
Thanks heaps :)

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to