Thanks Map, I appreciate the help. I'm still learning PHP as I go so there are probably a lot of stupid mistakes in the whole script.
Jeremy, I wasn't trying to bump my thread or infer that Chris was suppose to be my employee, it was already on top of the listings when I replied. Chris and Lady are just the people who end up helping me the most because they tend to be the only people to ever reply. I do admit, it was a pointless post for me to make.
Map, should the while statement look like this rather than what I originally had? I still haven't grasped where to, and where to not use single quotations.
PHP Code:
$result = mysql_query("SELECT * FROM products WHERE category1='$_GET[category1]'", $dbhandle); if (!empty($row['category2'])) { while ($row = mysql_fetch_array($result)) { // Show items with a category2. } } echo "<hr>"; if (empty($row['category2'])) { while ($row = mysql_fetch_array($result)) { // Show items without a category2 } }
EDIT: Is there a way to do an SQL query to see if a row has a value?
Example: SELECT * FROM products WHERE category2=HAS ANYTHING BUT BLANK
or would this be considered as "NOT NULL"? WHERE category2=NOT NULL
__________________
Please login or register to view this content. Registration is FREE
Coding is just like a woman. If you don't do something exactly right, it complains.
Last edited by WebTraffic; 11-20-2009 at 01:26 PM..
|