RE: [PHP-DB] Not seeing whats wrong with code
| From: | Beverly Steiner | Date: | Fri, 21 Mar 2003 00:36:58 +0000 |
| Subject: | RE: [PHP-DB] Not seeing whats wrong with code | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-26533@lists.php.net to get a copy of this message | ||
Mike,
Try mysql_fetch_array instead of mysql_fetch_row
----------------------
Beverly Steiner
steiner277@charter.net
-----Original Message-----
From: Mike Delorme [mailto:crazymonkey1385@hotmail.com]
Sent: Thursday, March 20, 2003 12:01 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Not seeing whats wrong with code
Hello,
I am trying to write a script that conects to mysql, then SHA database. Then
I need to list ALL the rows of table members. It sais there is a error on
line 18. The while statement is on line 18, and I cant firgure out whats
wrong with it:
<?
$host = "localhost";
$uname = "sniper";
$pass = "starcraft";
$database = "SHA";
$tablename = "members";
$connect = "mysql_connect ($host, $uname, $pass)";
$select = "mysql_select_db ($database)";
$query = "SELECT * from $tablename";
$result = mysql_query ($query)
while ($row = mysql_fetch_row($result))
{
$row
}
?>
Thanks,
Mike Delorme