Try this:
$parent_sql = "SELECT * FROM categories ORDER BY sort_order ASC";
$parent_result = mysql_query($parent_sql);
var_dump($parent_result);
while ($parent = mysql_fetch_array($parent_result) ) { <-- problem here
$parent_select .= "<option
value=\"".$parent['id']."\">".$parent['cat_name']."</option>";
}
Regards,
Andrey
----- Original Message -----
From: "Dan McCullough" <[EMAIL PROTECTED]>
To: "Andrey Hristov" <[EMAIL PROTECTED]>
Sent: Tuesday, January 08, 2002 7:00 PM
Subject: Re: [PHP] Supplied argument is not a valid MySQL result resource
> here is the sql
>
> $parent_sql = "SELECT * FROM categories ORDER BY sort_order ASC";
> $parent_result = mysql_query($parent_sql);
> while ($parent = mysql_fetch_array($parent_result) ) { <-- problem here
> $parent_select .= "<option
>value=\"".$parent['id']."\">".$parent['cat_name']."</option>";
> }
> --- 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]
> > >
> > >
> >
>
>
> =====
> dan mccullough
> --------------------------------------------------------
> "Theres no such thing as a problem unless the servers are on fire!"
>
>
> __________________________________________________
> 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]