Re: Supplied argument is not a valid MySQL result resource
| From: | Dan McCullough | Date: | Tue, 08 Jan 2002 17:05:18 +0000 |
| Subject: | Re: Supplied argument is not a valid MySQL result resource | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79801@lists.php.net to get a copy of this message | ||
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 <ahristov@icygen.com> 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" <McWC@rocketmail.com>
> To: "PHP General List" <php-general@lists.php.net>
> 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: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/