quick mysql question
#2

If the ID column is auto incrementing you can use cache_insert_id()

The example from the wiki uses a threaded query but that isn't required. You can use an unthreaded query as well like so:

pawn Код:
new Cache:cache = mysql_query(con, "INSERT INTO mytable (myColumn) VALUES (myValue)");
new insertID = cache_insert_id();
cache_delete(cache);
Reply


Messages In This Thread
quick mysql question - by TakeiT - 07.10.2014, 22:41
Re: quick mysql question - by Chenko - 07.10.2014, 23:33
Re: quick mysql question - by Shaneisace - 07.10.2014, 23:41
Re: quick mysql question - by TakeiT - 07.10.2014, 23:49
Re: quick mysql question - by TakeiT - 08.10.2014, 00:40
Re: quick mysql question - by Chenko - 08.10.2014, 02:08

Forum Jump:


Users browsing this thread: 2 Guest(s)