scotchegg78 Posted September 2, 2007 Share Posted September 2, 2007 Hey guys is there a Mysql or statement? example "SELECT * from leads WHERE HolderID = "' . $userid . "' OR AgentID = "' . $userid "'; thanks in advance Link to comment https://forums.phpfreaks.com/topic/67683-is-there-a-mysql-or-statement/ Share on other sites More sharing options...
Barand Posted September 2, 2007 Share Posted September 2, 2007 Yes, that's fine. Another version, replacing a string of OR statement like this ... WHERE (a=1) OR (a=2) OR (a=3) is ... WHERE a IN (1,2,3) So your query could be written as SELECT * from leads WHERE '$userid' IN (HolderID, AgentID ) Link to comment https://forums.phpfreaks.com/topic/67683-is-there-a-mysql-or-statement/#findComment-340040 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.