Hi guys,
I am trying invoking this code from another file - basically I need to output HTML rows in the variable $output:
$link = mysql_connect($OPTION_db_host, $OPTION_db_username, $OPTION_db_password) ;
// Link up with the database
if (!$link) {
die('Fatal Error: Could not connect: ' . mysql_error()) ;
}
//echo 'Connected successfully' ;
mysql_select_db($OPTION_db_name) or die('Fatal Error: Could not select database') ; // Select the database
$result = mysql_query("SELECT * FROM SHOW ORDER BY Rating");
for ($i = 1; $i <= 10; $i++) {
$row = mysql_fetch_array($result) ;
$output = "";
$output .= "<h1>$i. ";
$output .= $row['Name'] ;
$output .= "</h1>" ;
$output .= $row['Airs'] ;
$output .= " | " ;
$output .= $row['Timeslot'] ;
$output .= " | " ;
$output .= $row['Studio'] ;
}
mysql_close($link);
All i get as output is one row that looks like /10.| |/
Any pointers much appreciated! Thanks! 🙂