Fixed:
I had a ; at the end of the while loop (Fetch array) line
The purpose is to output an image (banner) from a row in mysql. I am 100% sure banners exist in the $row['banner'] column.
PHP Code:
<?php
// Connect to database
$connection = mysql_connect("localhost", "duckster_admin", "") or die("Could not connect to database");
// Select database
$db = mysql_select_db("duckster_amp", $connection) or die ("Could not select database");
// mySQL connection $query = "SELECT * FROM amp_ads";
// Show all Records
$result = mysql_query($query) or die("Query Failed: " . mysql_error());
// Table code here //
while($row = mysql_fetch_array($result));
{
//echo "<img src=\"$row[banner]\">";
echo "<img src=\"$row['banner']\">"; // This code don't work, what will work?
}
mysql_close($connection);
?>
As the echo statement says, what will work?
Error message:
Code:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /server path/
__________________
Made2Own
Last edited by Brian07002; 10-02-2011 at 01:42 PM..
|