I am doing an insert into a table. I need to lock the table before I do this insert so no one else can write to it while I am. how would I do this?
// This does an insert into the events table
$query = "INSERT INTO events (house,type,event_date,event_timestamp) ";
$query .= "VALUES ($event[FacId],4,'$event_date','$event[EventStartDateTime]');";
$result = pg_exec($con,$query);
Table Locking?
Moderator: General Moderators
run this as a query
LOCK TABLES table1 READ, table2 WRITE;
http://www.mysql.com/doc/en/LOCK_TABLES.html
LOCK TABLES table1 READ, table2 WRITE;
http://www.mysql.com/doc/en/LOCK_TABLES.html