punkpuke
04-04-2004, 07:07 AM
Hi, I have this simple script that is suppost to loop out Rows of Data into a big table. For some reason it says there is problems with the "while" loop first part of it. I'm pretty damn sure the SQL is right. Anyway, here it is...
<?php
$link = mysql_connect ("localhost","username","*******") or die ("Error: No connection to MySQL server\n");
$database = mysql_select_db("forgottenwraiths_com_main") or die ("Error: No Database Connection. \n");
$all_logins_sql = "SELECT username, password, real, level FROM users WHERE id > 0";
$all_logins_result = mysql_query($all_logins_sql);
if(mysql_error()){
die("There Was An Error Loading The Users List");
}
else
{
while($row = mysql_fetch_array($all_logins_result))
{
?>
<tr><td bgcolor="#e1e1e1">
<?php
echo "$row[real]";
?>
</td><td bgcolor="#e1e1e1">
<?php
echo "$row[username]";
?>
</td><td bgcolor="#e1e1e1">
<?php
echo "$row[password]";
?>
</td><td bgcolor="#e1e1e1">
<?php
echo "$row[level]";
?>
</td></tr>
<?php
}
}
?>
<?php
$link = mysql_connect ("localhost","username","*******") or die ("Error: No connection to MySQL server\n");
$database = mysql_select_db("forgottenwraiths_com_main") or die ("Error: No Database Connection. \n");
$all_logins_sql = "SELECT username, password, real, level FROM users WHERE id > 0";
$all_logins_result = mysql_query($all_logins_sql);
if(mysql_error()){
die("There Was An Error Loading The Users List");
}
else
{
while($row = mysql_fetch_array($all_logins_result))
{
?>
<tr><td bgcolor="#e1e1e1">
<?php
echo "$row[real]";
?>
</td><td bgcolor="#e1e1e1">
<?php
echo "$row[username]";
?>
</td><td bgcolor="#e1e1e1">
<?php
echo "$row[password]";
?>
</td><td bgcolor="#e1e1e1">
<?php
echo "$row[level]";
?>
</td></tr>
<?php
}
}
?>