mysql select
#1

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!
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)