|
Posted by Rafe Culpin on 03/07/06 21:20
In article <1141756865.538422.146370@j52g2000cwj.googlegroups.com>,
dpryde@gmail.com (Ababo) wrote:
> <?php
> $dbh=mysql_connect ("localhost", "myusername", "mypassword") or die ('I
> cannot connect to the database because: ' . mysql_error());
> mysql_select_db ("ababoc_filmlistings");
>
> $sql = 'SELECT DISTINCT title FROM Listing';
> $rs = mysql_query($sql);
>
> $row = mysql_fetch_row($rs); // line 24
> echo $row[0];
>
> ?>
>
> but I end up with the error:
>
> Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
> result resource in /home/ababoc/public_html/test/index.php on line 24
If $rs isn't a valid result it implies that something went wrong in
creating it. Either in selecting the database or in running the query.
Look at the mysql_error() after each of those.
--
To reply email rafe, at the address cix co uk
Navigation:
[Reply to this message]
|