-> Mike,
MD> I have been having this problem for a while now, and I cant figure it out. the
code is:
MD> <?
MD> $host = "localhost";
MD> $uname = "sniper";
MD> $pass = "starcraft";
MD> $database = "sha";
MD> $tablename = "members";
MD> $connect = mysql_connect ($host, $uname, $pass);
MD> $select = "mysql_select_db ($database)";
MD> $query = "SELECT * from $tablename";
MD> $result = mysql_query ($query, $connect);
MD> while ($row = mysql_fetch_array($result))
MD> {
MD> print_r( $row );
MD> echo mysql_error();
MD> }
?>>
MD> mysql has an error on line 19. Line 19 is while ($row =
mysql_fetch_array($result)). What am I doing wrong?
MD> Thanks for your help,
MD> Mike
ensure $result is correct:
<?
$host = "localhost";
$uname = "sniper";
$pass = "starcraft";
$database = "sha";
$tablename = "members";
$connect = mysql_connect ($host, $uname, $pass);
what is that? ;] -> $select = "mysql_select_db ($database)"; # why do u use ""?
$query = "SELECT * from $tablename";
$result = mysql_query ($query, $connect);
while ($row = mysql_fetch_array($result))
{
print_r( $row );
echo mysql_error();
}
?>
Yours L0vCh1Y
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php