Here is the code

$parent_select = "<TR><TD BGCOLOR=\"#F7F7F7\"><FONT FACE=\"Verdana, Arial, Tahoma\" 
SIZE=\"2\"
COLOR=\"#000000\">Parent Category:</font></td><TD BGCOLOR=\"#F7F7F7\" 
WIDTH=\"80%\"><select
name=\"parent_id\">";
$parent_sql = "SELECT * FROM categories ORDER BY sort_order ASC";
$parent_result = mysql_query($parent_sql);
while ($parent = mysql_fetch_array($parent_result) ) { <-- the problem line
$parent_select .= "<option 
value=\"".$parent['id']."\">".$parent['cat_name']."</option>";
}
$parent_select = "</select></td></tr>\n";
print $parent_select;


this is similar to code that I use to get the result for several other places


--- Andrey Hristov <[EMAIL PROTECTED]> wrote:
> Possibilities:
> 1)There was an error when mysql_query(). Possibly the SQL statement is not correct. 
>Trace with
> var_dump()/mysql_errno().
> 2)You give as parameter to some of mysql_* functions a variable not returned from 
>mysql_query().
> 
> HTH
> 
> Regards,
> Andrey Hristov
> 
> ----- Original Message ----- 
> From: "Dan McCullough" <[EMAIL PROTECTED]>
> To: "PHP General List" <[EMAIL PROTECTED]>
> Sent: Tuesday, January 08, 2002 6:47 PM
> Subject: [PHP] Supplied argument is not a valid MySQL result resource
> 
> 
> > I know this is a common error, but what does it mean.  This snippet of code is 
>something I use
> all
> > the time.
> > 
> > help please.
> > 
> > dan
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Send FREE video emails in Yahoo! Mail!
> > http://promo.yahoo.com/videomail/
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to