MySQL Insert ID Error
#1

Hello there,

So I have this little problem, when I insert something with mysql_query, function mysql_insert_id should return number of Auto Increment column, for some reason, it doesn't, it always return 0. And also, I set default value (start value) of auto increment to be 34, but when the first item is inserted id is 1, I also tested it from php to insert, and it works fine, start value is 34. There is no need to show you query, because I'm very good with SQL, and this is some strange s*it. So if anyone could give me some helping intel, just post here.

Thanks in advance.
Reply
#2

which version of mysql plugin are you using
if you use R7 you need to do this

pawn Код:
mysql_function_query(1,"INSERT INTO ........................",true,"GetLastInsertID","");


forward GetLastInsertID();
public GetLastInsertID()
{
      printf("%d",mysql_insert_id(1));
      return 1;
}
Reply
#3

I'm on R6
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)