-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Hi @mychidarko how are you? I need help. I have problem with the lastInsertId() function. Always it returns 0.
db()->insert("{$this->dbName}.{$table}")->params($params)->execute(); $lastInsertId = db()->query("SELECT LAST_INSERT_ID();")->fetchAll(); dd($lastInsertId); return (int) $lastInsertId;
Also return 0 if i do:
db()->lastInsertId()
But in pure mysql works:
INSERT INTO event_place_mappings (event_id, place_id) VALUES (56, 33); SELECT LAST_INSERT_ID();
mysql Ver 9.3.0 for Linux on x86_64 (MySQL Community Server - GPL)
Thanks!
Metadata
Metadata
Assignees
Labels
No labels