Re: MySQL Problem -- Please help

2001-06-09 Thread oltra jean-michel


> When I run test.php I get this:
>
> Warning: Supplied argument is not a valid MySQL result resource in common.php on 
>line 27
> 0
>
> Here are lines 25-27:
> 25: $sql = "select urate, arate, inhits from sitestats where id = $id";
> 26: $r = mysql_query($sql);
> 27: $row = mysql_fetch_array($r);
>
> I thought using the result identifier returned by mysql_query in mysql_fetch_array 
>was perfectly legal.

bonjour,

Try: ...where id = '$id'";
on line 25

jean-michel


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: MySQL Problem -- Please help

2001-06-09 Thread Chris Bolt

> I thought using the result identifier returned by mysql_query in
> mysql_fetch_array was perfectly legal.

mysql_query() doesn't always return a valid result identifier if an error
occurs (echo mysql_error()) or if no rows are returned.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php