I have this web site "EGT Worlds" (egtworlds.com) which is a active directory and I want to spit out some MySql data into a div tags but when I close of the function I get this:
Parse error: syntax error, unexpected '}' in
C:\xampp\htdocs\core\wallofworlds.php on line 31
But it doesn't close before that line and I need it to read the mysql_close($con); string at the end. Its as if
PHP is choking over my data.
Here is the my code:
- PHP: Select all
<?php
include 'core/lang.php';
include 'core/MySql.php';
$mainTitle = "The Wall of Worlds - EGT Worlds";
echo '<h3>Wall of Worlds: The sites that have already submitted.</h3><p>Here are some of the sites that ambitious webmasters who have already submitted into the EGT Worlds directory. If your site is not submitted, please submit it by clicking the "Add A Site" above.</p>';
$varHasRows = 0;
$con = mysql_connect("localhost","A User Name","A Password");
if (!$con)
{
echo 'Could not connect: ' . mysql_error();
}
If (!mysql_select_db("egtworlds", $con)) {
echo 'Could not process: ' . mysql_error();
}
If (!mysql_query("Select * From websites")) {
echo 'Could not process: ' . mysql_error();
}
$result = mysql_query("Select * From websites");
while($row = mysql_fetch_array($result)){
$strImageText = "No image was uploaded yet.";
if (!trim($row['WebScreenShot']) == '' ) {$strImageText = '<img alt="' . $row['WebName'] . '" src="' . $row['WebScreenShot'] . ' " />';}
echo '<div class="frmTableRow"><div class="frmLabelCol"><h4>' . $row['WebName'] . '</h4><div class="frmImageCaptLarge"><a href="' . $row['WebPage'] . '" >' . $strImageText . '</a></div></div><div class="frmItemCol"><p>' . $row['WebDescription'] . '</p><p>Home Page: <a href="' . $row['WebHomePage'] . '">' . $row['WebHomePage'] . '</a></p><p>Home Page: <a href="' . $row['WebPage'] . '">' . $row['WebPage'] . '</a></p></div></div>';
}
mysql_close($con);
}
?>
Could you please help a novice
PHP-er?