Help, Insert and select in the same query (MySQL)
#1

How do I insert something into the database and select the same query? I tried to do this but there is the following:

"SELECT max (` conce_id`) as maximum FROM `concecars` '" If you have an error in your SQL syntax, check the manual that corresponds to your MySQL server for the right syntax to use near'

the query is this:

"SELECT max (` conce_id`) as maximum FROM FROM 'INSERT INTO `concecars` (` conce_dono`, `conce_pos`,` conce_color`) VALUES (' Yoshi ', '555.302002, 555.302002, 555.302002', '1, 1'); `concecars`;"

in the database works, but within the game mode does not work. Can someone help me?
Reply
#2

So you want to extract the last inserted id? If yes then check out https://sampwiki.blast.hk/wiki/MySQL#cache_insert_id
If you use this in callback called byt a insert query you get hte last inserted id
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)