mysql_insert_id return 0
#2

Try using mysql_store_result beforehand, it's all I can think of as the code looks fine and it does make sense. So for example:

pawn Код:
format(motd, sizeof(motd), "INSERT INTO `cocars` (`vModel`, `vUsage`, `vRespawnDelay`, `vOwner`, `vSpawned`) VALUES ('%d', '%d', '-1', '%s', '1')",
GetPVarInt(playerid, "SelectedForBuy")+400,
CAR_USAGE_PRIVATE,
playername);
mysql_query(motd, INSERT_VEHICLE_QUERY);
mysql_store_result();
printf("MySQL Report: mysql_insert_id is %d.", mysql_insert_id());
mysql_free_result(); // Don't forget to free it then.
Reply


Messages In This Thread
mysql_insert_id return 0 - by CoaPsyFactor - 05.06.2012, 23:08
Re: mysql_insert_id return 0 - by JaTochNietDan - 06.06.2012, 08:45
Re: mysql_insert_id return 0 - by CoaPsyFactor - 06.06.2012, 08:51
Re: mysql_insert_id return 0 - by JaTochNietDan - 06.06.2012, 08:53
Re: mysql_insert_id return 0 - by CoaPsyFactor - 06.06.2012, 09:14

Forum Jump:


Users browsing this thread: 1 Guest(s)