...

View Full Version : Resource ID #7 Error



harlequin2k5
10-27-2006, 07:43 PM
I'm trying to use this query that I've used previously but now it's giving me a resource #7 error

I tried to look the error up on php and couldn't find the answer


<?
doconnect();

$query="SELECT * FROM tblUsers";
$result=mysql_query($query) or die(mysql_error());
$row=mysql_fetch_array($result);

echo "<table width=\"90%\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">\n";
echo "<tr>\n";
echo "<th>User Name</th><th>User ID</th><th>User Type</th>\n";
echo "</tr>\n\n";
echo "<tr>\n";

"\n";
while ($row=mysql_fetch_array($result))
"\n";
{
"\n";
echo "<td>" . $row['UserFirstName'] . " " . $row['UserLastName'] . "</td><td>" . $row['UserID'] . "</td><td>" . $row['UserType'] . "</td>\n";
}

echo "</tr>\n\n";
echo "</table>\n";

?>

any help is greatly appreciated :)

Brandoe85
10-27-2006, 08:05 PM
Hi,

Take out the \n's that you have in the open, specifically the one right after the while loop:


while ($row=mysql_fetch_array($result))
{
echo "<td>" . $row['UserFirstName'] . " " . $row['UserLastName'] . "</td><td>" . $row['UserID'] . "</td><td>" . $row['UserType'] . "</td>\n";
}


Good luck;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum