• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] cache_insert_id always return 0
#1
Hi, sorry how bad this was.

I've created a team and the table is also is AI mode. There are multiples team in the query but whenever server restart or player quit, then create team, it always started at 0 again.

PHP Code:
forward TeamCreated(b);
public 
TeamCreated(b)
{

? ? 
TeamInfo[b][TeamID] = cache_insert_id();
? ? 
teamidd;
? ? 
printf("New Group is created: [%d]"teamidd );



PHP Code:
if(strcmp(usage"create"false) == 0)
{
? ? if(!
strlen(usage1)) return SCP(playerid"create <teamname>");
? ? if(
strlen(usage1) < || strlen(usage1) > 30) return SendClientError(playerid"Your team name is too short or too long! (Min 5, Max 30 chars)");
? ? new 
tmID teamidd;
? ? if(
PlayerInfo[playerid][tplayerteam] != -1) return SendClientError(playerid"You are already in a team. /team leave");
? ? 
TeamInfo[tmID][TeamID] = tmID;
? ? 
PlayerInfo[playerid][tplayerteam] = tmID;
? ? 
PlayerInfo[playerid][tranklvl] = 0;
? ? 
myStrcpy(PlayerInfo[playerid][TPTeamName],usage1);
? ? 
myStrcpy(PlayerInfo[playerid][trankname],"Children");
? ? 
TeamInfo[tmID][TActive]=true;
new 
sQuery[528];
mysql_format(sqldbsQuerysizeof sQuery"INSERT INTO `TeamInfo` (`TeamID`, `TeamName`, `StartRank`) VALUES (%d,'%e', 'Children')",tmID,usage1);
mysql_tquery(sqldbsQuery"TeamCreated""i",tmID);
}
else
{
SCP(playerid"<create> <input>");
}
return 
1;

  Reply


Messages In This Thread
cache_insert_id always return 0 - by Axitz - 2022-03-30, 07:41 AM
RE: cache_insert_id always return 0 - by FARADAY - 2022-03-31, 07:11 PM
RE: cache_insert_id always return 0 - by Axitz - 2022-04-01, 03:02 AM
RE: cache_insert_id always return 0 - by FARADAY - 2022-04-01, 09:56 PM
RE: cache_insert_id always return 0 - by Radical - 2022-04-01, 10:07 PM
RE: cache_insert_id always return 0 - by Axitz - 2022-04-07, 04:07 AM

Forum Jump: