"OR" in SQL Query
Posted: Mon Jan 11, 2010 4:52 pm
I would like to select 2 different variables from my database. I wrote it like this:
$sql = "SELECT * FROM `Catalog` WHERE title = '{$article['alsolike']}' OR '{$article['alsolike2']}' ";
That does not seem to work.
The idea would be that it would output as such:
$sql = "SELECT * FROM `Catalog` WHERE title = 'Germany' OR 'Ireland' ";
How would this be written correctly?
$sql = "SELECT * FROM `Catalog` WHERE title = '{$article['alsolike']}' OR '{$article['alsolike2']}' ";
That does not seem to work.
The idea would be that it would output as such:
$sql = "SELECT * FROM `Catalog` WHERE title = 'Germany' OR 'Ireland' ";
How would this be written correctly?