0

Hi, I have been left in the lurch with a few php scripts on my site and I'm the first to admit coding is not my strong point! I have managed to fix most of the issues, but I am stuck on the following. Basically, I want to query the same row twice in a multiple query, but having problems figuring it out. This is the code I have;

$query = "SELECT items.iname, grow.name "."FROM items, grow "."WHERE items.iname = grow.name and grow.location='$arch' and items.ownerid='$sid'";

This works fine, (its for a drop-down list), however I want to add to the location to echo rows where location=$arch and also where location=no. I have tried IN but it didn't work. Any help would be appreciated, many thanks.

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by diafol
1
"WHERE items.iname = grow.name AND items.ownerid='$sid' AND (grow.location = '$arch' OR grow.location = 'no')"

Like that?

Votes + Comments
Helpful answer and solved problem.
0
"WHERE items.iname = grow.name AND items.ownerid='$sid' AND (grow.location = '$arch' OR grow.location = 'no')"

Like that?

Perfect, makes sense when you know the answer! Thank you.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.