12.02.2017, 10:46
Ugh, why is this not inserting anything in the mysql?
The command is working because I get the message with the name when I use it but nothing is inserting in the database.
PHP код:
else if(strcmp(param, "create", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new Float:x, Float:y, Float:z, dstring[180], DB_Query[180];
GetPlayerPos(playerid, x, y, z);
if(ex == (-1) || ey == (-1) || ez == (-1)) return SCM(playerid, COLOR_GREY, "/druglab create <ExitXPos>, <ExitYPos>, <ExitZPos>, <Name>");
mysql_format(Database, DB_Query, sizeof(DB_Query), "INSERT INTO `DrugLabs` ( `Name`, `ExitX`, `ExitY`, `ExitZ`, `EntranceX`, `EntranceY`, `EntranceZ`)\
VALUES ( %s, %f, %f, %f, %f, %f, %f)", name, ex, ey, ez, x, y, z);
mysql_tquery(Database, DB_Query);
format(dstring, sizeof(dstring), "Druglab created | Name: %s ", name);
SCM(playerid, COLOR_YELLOW, dstring);
}
}