SA-MP Forums Archive
mysql select - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql select (/showthread.php?tid=555883)



mysql select - n00el - 09.01.2015

Hello, i have a mysql select but its wrong, and i donw know why..

Код:
format(query, sizeof(query), "SELECT `ID` FROM `friends` WHERE `friend1` = '%d' AND `friend2` = '%d' OR `friend1` = '%d' AND `friend2` = '%d'", PlayerData[playerid][pID], PlayerData[i][pID], PlayerData[i][pID], PlayerData[playerid][pID]);
And in the log, friend1's id is okay, but the friend2's id is always '' (none).
I debug it with printf(playerdata[playerid[pid]....[i][pid]) and its good. but in the mysql nothing. :/
any idea? thanks!


Re: mysql select - ball - 09.01.2015

Try this

Код:
format(query, sizeof(query), "SELECT `ID` FROM `friends` WHERE (`friend1` = '%d' AND `friend2` = '%d') OR (`friend1` = '%d' AND `friend2` = '%d')", PlayerData[playerid][pID], PlayerData[i][pID], PlayerData[i][pID], PlayerData[playerid][pID]);
If this won't work give more code and mysql log.