webdev007
Programmer
- Sep 9, 2005
- 168
This really is bugging me
as you see even in debugging mode I do ne get any mysql error
If I echo the query I obtain the expected result
further even if below the script excerpt if I echo the values I again get the expected result
so where is the error for something so basic
what am I overlooking at?
the error is on the last line (while...)
and tels me "supplied ressorce is not a valid...
thanks
$query = "SELECT city, name, rating
FROM
rating_AAAA
WHERE
city='$city' ";//echo"1Q: $query<p>";
//$result = mysql_query($query) or die(mysql_error());
$result = mysql_query($query);
if(! $result || mysql_error() || mysql_num_rows($result) < 1)
{
echo sprintf('%s rows, [%s] , error: %s',
mysql_num_rows($result),
$query,
mysql_error());
exit;
}
while($row=mysql_fetch_array($result))
as you see even in debugging mode I do ne get any mysql error
If I echo the query I obtain the expected result
further even if below the script excerpt if I echo the values I again get the expected result
so where is the error for something so basic
what am I overlooking at?
the error is on the last line (while...)
and tels me "supplied ressorce is not a valid...
thanks
$query = "SELECT city, name, rating
FROM
rating_AAAA
WHERE
city='$city' ";//echo"1Q: $query<p>";
//$result = mysql_query($query) or die(mysql_error());
$result = mysql_query($query);
if(! $result || mysql_error() || mysql_num_rows($result) < 1)
{
echo sprintf('%s rows, [%s] , error: %s',
mysql_num_rows($result),
$query,
mysql_error());
exit;
}
while($row=mysql_fetch_array($result))