30.12.2016, 20:37
Hello,
I want to detect if a table exist with playername and variable.
Can someone help me out?
I tried this:
But gave me errors:
Please help me out.
Admigo.
I want to detect if a table exist with playername and variable.
Can someone help me out?
I tried this:
Код:
stock ExistPlayerClothes(playerid,pageid) { format(query, sizeof(query), "SELECT * FROM `"#MYSQL_CLOTHES_TABLE2"` WHERE `PlayerName` = '%s' AND `ClothesPageID` = %d", GetName(playerid),pageid); mysql_tquery(gSQL, query, "ExistPlayerClothesMYSQL", "i", playerid); return 1; }
Код:
[21:50:39] [ERROR] CMySQLQuery::Execute[ExistPlayerClothesMYSQL] - (error #1054) Unknown column 'ClothesPageID' in 'where clause' [21:50:39] [DEBUG] CMySQLQuery::Execute[ExistPlayerClothesMYSQL] - error will be triggered in OnQueryError forward ExistPlayerClothesMYSQL(playerid); public ExistPlayerClothesMYSQL(playerid) { new rows, fields; cache_get_data(rows, fields); if(!rows) { //if not exist create new row CreatePlayerClothes2Page(playerid); return 1; } return 1; }
Admigo.