RE: [PHP] mysql
| From: | Martin Towell | Date: | Thu, 31 Jan 2002 05:51:56 +0000 |
| Subject: | RE: [PHP] mysql | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-82870@lists.php.net to get a copy of this message | ||
does executing $query through the mysql interface return anything? I'm
thinking there's either:
1. An error in the SQL - but it looks good to me, or
2. It returns no records
That's the only thing I can think of.
Martin
-----Original Message-----
From: Mason Batley [mailto:mason@section31.com.au]
Sent: Thursday, January 31, 2002 4:48 PM
To: php-general@lists.php.net
Subject: [PHP] mysql
G'day
I keep getting an error message of :Warning: Supplied argument is not a
valid MySQL result resource in /var/www/html/RageProject/StripPlayList.php
on line 100
Rows:
$link = mysql_connect("127.0.0.1", "rage", "rage");
mysql_select_db("rage");
$query = "Select id from songs
where songname = '$Song' and
artist = '$Artist'";
$result = mysql_query($query);
$rows = mysql_num_rows($result); <<< Line 100
echo "Rows: $rows";
mysql_close($link);
Can someone explain why.. I've been trying to work it out for 2 long.