I use custom query for insert/delete/update
$calendar->sql->attach("Update", "Update calendario set event_name='{event_name}',start_date='{start_date}',end_date='{end_date}',cliente={cliente},attivita={attivita},utente={utente},fatturata={fatturata} where event_id={event_id} and id_azienda={id_azienda}");
$calendar->sql->attach("Insert", "Insert into calendario (id_azienda,event_name,start_date,end_date,cliente,attivita,utente,fatturata) values ({id_azienda},'{event_name}','{start_date}','{end_date}',{cliente},{attivita},{utente},{fatturata})");
$calendar->sql->attach("Delete", "Delete from calendario where event_id={event_id} and id_azienda={id_azienda}");
In database, on table “calendario” there’s my PK, field “event_id” int 11 autoincrement.
After create a new event, ID is a random.
I have to reload page to get correct ID from db table.
How can I fix this problem?
I want in client-side the event have correct ID from last inserted in database.
Thanks to all