Gathering data from a database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been having this problem for a while now, and I cant figure it out. the code is:
<?
$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, $connect);

while ($row = mysql_fetch_array($result))
{
print_r( $row );
echo mysql_error();
}
?>

mysql has an error on line 19. Line 19 is while ($row = mysql_fetch_array($result)). What am I doing wrong?


Thanks for your help,
Mike

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux