You are here: Re: MySQL PHP problems « PHP Programming Language « IT news, forums, messages
Re: MySQL PHP problems

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация