Pentiums Posted November 11, 2008 Report Share Posted November 11, 2008 Ar šo kveriju jāpārbauda vai datubāzē eksistē jau šāds epasts, vai lietotājvārds, bet vajag izlaizt no rezultāta pašreizējo lietotāju, bet ar NOT operatoru laikam iebraucu auzās.. help.. SELECT * FROM lietotaji WHERE lietotajs='$lietotajvards' OR epasts='$epasts' AND NOT id = '$pasreizejais_id' Link to comment Share on other sites More sharing options...
xPtv45z Posted November 11, 2008 Report Share Posted November 11, 2008 ... AND id <> '$pasreizejais_id' mysql'ā laikam darbojas arī != Link to comment Share on other sites More sharing options...
Grey_Wolf Posted November 11, 2008 Report Share Posted November 11, 2008 SELECT * FROM lietotaji WHERE lietotajs='$lietotajvards' OR epasts='$epasts' AND id != '$pasreizejais_id' Tapat kaa PHP != Link to comment Share on other sites More sharing options...
Pentiums Posted November 11, 2008 Author Report Share Posted November 11, 2008 aizgāja, tikai AND iekavoju, savādāk nestrādāja kā vajadzētu SELECT * FROM lietotaji WHERE id != '$pasreizejais_id' AND(lietotajs='$lietotajvards' OR epasts='$epasts') Link to comment Share on other sites More sharing options...
bubu Posted November 11, 2008 Report Share Posted November 11, 2008 Operatoru prioritātes jāzin: http://dev.mysql.com/doc/refman/5.0/en/ope...precedence.html Tas pats ir arī php valodā btw: http://lv2.php.net/operators#language.operators.precedence Link to comment Share on other sites More sharing options...
Recommended Posts