palvaneh
3091
7
Laravel

How to get insert id for raw inserts

Posted 2 years ago by palvaneh

because I use MySQL spatial functions, I'm using raw insert queries.

DB::insert(INSERT INTO mytable (name, loc) VALUES ('test', POINT(?, ?)), [
    $lon, $lat
]);

how to get id of inserted row?

Please sign in or create an account to participate in this conversation.