madspof Posted January 13, 2008 Share Posted January 13, 2008 Hi everyone i am trying to create a mysql query that finds something in a row when the WHERE in the query has to variables it has to satisfy here is what i am try to do (is this possible): This is what i have now $query = "SELECT url FROM userpic WHERE DP = '1'"; And i need something like this $query = "SELECT url FROM userpic WHERE DP = '1' & userid = '$usern'"; i am not sure if this is the correct way of going about it. Link to comment https://forums.phpfreaks.com/topic/85750-solved-is-it-possible-to-do-this/ Share on other sites More sharing options...
revraz Posted January 13, 2008 Share Posted January 13, 2008 Replace & with AND and it would work fine. Link to comment https://forums.phpfreaks.com/topic/85750-solved-is-it-possible-to-do-this/#findComment-437640 Share on other sites More sharing options...
madspof Posted January 13, 2008 Author Share Posted January 13, 2008 okay thanks Link to comment https://forums.phpfreaks.com/topic/85750-solved-is-it-possible-to-do-this/#findComment-437642 Share on other sites More sharing options...
toplay Posted January 13, 2008 Share Posted January 13, 2008 Yes, use && or AND, but one & because it is a BITWISE operator. http://dev.mysql.com/doc/refman/4.1/en/non-typed-operators.html Link to comment https://forums.phpfreaks.com/topic/85750-solved-is-it-possible-to-do-this/#findComment-437645 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.