12.05.2014, 16:21
Hello,
This is my code:
He have to set a ID for any cars in my database.
So, car1 = 1 car2 = 2 car4=4 etc...
But, I have this: car1=1 (when I create the first), but when I create a second car, I got this: car1= 2 car2 = 2
I don't know why...
Regards
This is my code:
Код:
mysql_query("SELECT * FROM cars");
mysql_store_result();
new i=1,query[256];
while(mysql_retrieve_row())
{
format(query,sizeof(query),"UPDATE cars SET realid='%d' ",i);
mysql_query(query);
i++;
}
So, car1 = 1 car2 = 2 car4=4 etc...
But, I have this: car1=1 (when I create the first), but when I create a second car, I got this: car1= 2 car2 = 2
I don't know why...
Regards

