I am creating module that need to lock table:
db_query('LOCK TABLES {eventi_list} READ');
$is_booked = _is_booked($uid, $nid);
if (! $is_booked) {
$is_booked = _is_booked($uid, $nid, 'eventi_waiting_list');
}
if (! $is_booked) {
$amount = _get_free_amount($nid);
if ($amount > 0) {
$insert = db_query("INSERT INTO {eventi_list} (uid, nid) VALUES($uid, $nid)");
}
else {
$time = time();
$insert = db_query("INSERT INTO {eventi_waiting_list} (uid, nid, created_at) VALUES($uid, $nid, $time)");
}
$update = db_query("UPDATE {content_type_event} SET field_event_places_amount_value = field_event_places_amount_value - 1 WHERE nid=$nid");
}
db_query('UNLOCK TABLES');
I am getting error (4 similar warnings):
Warning: Table 'watchdog' was not locked with LOCK TABLES query:
INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (19, 'php', '%message in %file on line %line.', 'a:4:{s:6:"%error";s:12:"user warning";s:8:"%message";s:139:"Table eventi_waits was not locked with LOCK TABLES query: SELECT count(nid) AS count FROM eventi_waits WHERE nid=201 AND uid=19";s:5:"%file";s:95:"D:\tools\xampp\htdocs\drupal\sites\bartenders.localhost.com\modules\\custom\eventi\eventi.module";s:5:"%line";i:115;}', 3, '', 'http://bartenders.localhost.com/bartender/book/201/%3Fdestination%3D/eventi/justin-knows', 'http://bartenders.localhost.com/eventi/justin-knows', '127.0.0.1', 1303900341) in D:\tools\xampp\htdocs\drupal\includes\database.mysqli.inc on line 135
What can I do with this, turn off database reporting?