salve ho 2 tabelle
1- prenotazioni
1- postazioni
nella tabella prenotazioni inserisco la postazione.
Ho la necessita che dopo avere inserito la prenotazione devo impostare un campo nella tabella postazioni su occupato.
Il trigger fa questo su after insert della tabella prenotazioni
UPDATE postazioni
SET postazioni.status='OCC'
WHERE postazioni.id = new.postazione_id "
questo รจ su page events ma non so come impostarlo
$table_data = array(
"fieldname" => "value",
"fieldname2" => "value2"
);
$db->where("table_id", $rec_id);
$bool = $db->update("tablename", $table_data);
after insert - tabella prenotazioni
$table_data = array(
"status" => "OCC",
"postazione_id" => $rec_id
);
$db->where("id", $rec_id);
$bool = $db->update("postazioni", $table_data);
se inserisco questo codice ho error 500