Click to See Complete Forum and Search --> : no output from loop


Conor
03-14-2004, 01:49 PM
<?
include("common.php");
$sql = "SELECT * FROM disco_tunes";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);

for ($x = 0; $x < $rows; $x++)
{
$ID = mysql_result($result, $x, 'ID');
$tune = mysql_result($result, $x, 'tune');
$user = mysql_result($result, $x, 'user');

echo $ID.'<br>'.$tune.'<br>'.$user.'<br><br>.';
}

?>


common.php is where my connection is being made.

jpmoriarty
03-14-2004, 05:16 PM
can't see any problems there... what happens if you do a echo $rows before the loop - is it >0?

olaf
03-16-2004, 09:07 AM
check the "mysl_query" command with some error -reporting like:

mysql_query($query) or die(mysql_error());