View Single Post
  #1 (permalink)  
Old Apr 18th, 2008, 18:56
TheSealPortalTeam's Avatar
TheSealPortalTeam TheSealPortalTeam is offline
User of Users

SuperMember
Join Date: May 2007
Location: Buffalo
Posts: 290
Blog Entries: 15
Thanks: 6
Thanked 1 Time in 1 Post
Question [SOLVED] I don't know why but my mysql code is all messed up

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?
__________________
If I was a big money making person, You wouldn't be here, but You are. (Nothing personal, just a joke!)
EGT Worlds: The funny thing about web portals. Finished!

Last edited by Jack Franklin; Apr 19th, 2008 at 08:11.
Reply With Quote