[SOLVED] I don't know why but my mysql code is all messed up

This is a discussion on "[SOLVED] I don't know why but my mysql code is all messed up" within the PHP Forum section. This forum, and the thread "[SOLVED] I don't know why but my mysql code is all messed up are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 18th, 2008, 18:56
TheSealPortalTeam's Avatar
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 Blog Entry: Planning Ahead (Yesterday)

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

  #2 (permalink)  
Old Apr 18th, 2008, 19:04
SuperMember

SuperMember
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: I don't know why but my mysql code is all messed up

Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\core\wallofworlds.php on line 31

Try removing the very last} in you code.

Pat
Reply With Quote
  #3 (permalink)  
Old Apr 18th, 2008, 19:07
TheSealPortalTeam's Avatar
User of Users

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

Oh da, its not a function here I thought I was righting a function.
(Doh! - hammer hits head)

Oh well, thats what you get for forgetting the coffee.
__________________
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 Blog Entry: Planning Ahead (Yesterday)
Reply With Quote
  #4 (permalink)  
Old Apr 19th, 2008, 08:10
Junior Member
Join Date: Jul 2007
Location: Arkansas, USA
Age: 21
Posts: 45
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nashultz07 Send a message via MSN to nashultz07
Re: I don't know why but my mysql code is all messed up

he he, it is always the simple mistakes that we all overlook every once in a while. I love how php will tell you where your mistake is (giving you which line is causing the problem).

Take care,
Nathon Shultz
Last Blog Entry: First Post! (Apr 18th, 2008)
Reply With Quote
  #5 (permalink)  
Old Apr 21st, 2008, 15:48
TheSealPortalTeam's Avatar
User of Users

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

lol, that was a frustrating day,
close the topic
__________________
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 Blog Entry: Planning Ahead (Yesterday)
Reply With Quote
Reply

Tags
mysql, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Linking php code to a form &amp; mysql database longstand PHP Forum 21 Oct 9th, 2007 16:40
Please Help I have messed up! Teejay Databases 1 Nov 5th, 2006 14:37
Help - messed up! Pickle JavaScript Forum 1 Feb 21st, 2006 11:58
Something messed up... Jdinh04 Web Page Design 2 May 18th, 2005 23:33


All times are GMT. The time now is 11:50.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43