Page is a not externally linkable
henry0 - 8:42 pm on Jul 19, 2008 (gmt 0)
Instead you could use a nested query such as: // note we do not close the first curly bracket select etc... ++$i2; ++$i; it's up to you to adding the sub query conditions (Where....) the above will display each category with its related products one section at a time. <edit>Typo</edit> [edited by: henry0 at 9:04 pm (utc) on July 19, 2008]
It looks like WHERE EXISTS has somme limitation for example:
If a row exists and contains nothing but NULL value
then it will be still returned
MANUAL [dev.mysql.com]
select category_name
from etc..
do a first num rows $num=....
// first while
$i=0;
while ($i<$num)
{
$cat_name=.....
echo the cat name rows
// second query
do a second num rows
but name $result $result 2 $num $num2 and $i $i2
(to avoid query confusion)
$i2=0;
while ($i2<$num2)
{
grab and echo the rest of your fields
}// ends $i2 while
} // ends $i while