Hi all,
I have a database which I would like to use to power an HTML list.
I'm struggling to get the loop to print out more than one line.
This is the script:
<?php
$query = "SELECT * FROM `table` ORDER BY `year` ASC";
$resultID = mysql_query($query, $conn) or die("Data not found.");
for($y = 1 ; $y < mysql_num_rows($resultID) ; $y++){
$row = mysql_fetch_assoc($resultID);
$xml_output2 = "<li id=\"";
$xml_output2 .= $row['year']."\">";
$xml_output2 .= "<img src=\"/images/".$y.".png\" width=\"256\" height=\"256\" />";
$xml_output2 .= "<h1>".$row['location']."</h1><p>".$row[…
//echo $xml_output2;
}
?>
Database connection is okay, and columns all match.
On viewing the source, one line seems to have have been pulled in correctly, but that's all.
Please help! Thanks