Web Design and Development Forums

[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 > Program Your Website > PHP Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 18th, 2008, 18:56   #1 (permalink)
 
TheSealPortalTeam's Avatar
 
Join Date: May 2007
Location: Buffalo
Posts: 241
Blog Entries: 12
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 only life came with an Energy Button.
If Firefox came bundled with Microsoft, I'd be happy.

Last edited by Jack Franklin; Apr 19th, 2008 at 08:11.
TheSealPortalTeam is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 18th, 2008, 19:04   #2 (permalink)
 
Join Date: Jun 2007
Location: uk
Posts: 459
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
dab42pat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 18th, 2008, 19:07   #3 (permalink)
 
TheSealPortalTeam's Avatar
 
Join Date: May 2007
Location: Buffalo
Posts: 241
Blog Entries: 12
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 only life came with an Energy Button.
If Firefox came bundled with Microsoft, I'd be happy.
TheSealPortalTeam is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 19th, 2008, 08:10   #4 (permalink)
Junior Member
 
Join Date: Jul 2007
Location: Arkansas, USA
Age: 21
Posts: 44
Blog Entries: 1
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
__________________
nashultz07 CSS Trickery: CSS Tips and Tricks
nashultz07 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 21st, 2008, 15:48   #5 (permalink)
 
TheSealPortalTeam's Avatar
 
Join Date: May 2007
Location: Buffalo
Posts: 241
Blog Entries: 12
Re: I don't know why but my mysql code is all messed up

lol, that was a frustrating day,
close the topic
__________________
If only life came with an Energy Button.
If Firefox came bundled with Microsoft, I'd be happy.
TheSealPortalTeam is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
mysql, php

Thread Tools
Rate This Thread
Rate This Thread:

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] Array code help longstand PHP Forum 3 Dec 1st, 2007 15:14
[SOLVED] Php code problem longstand PHP Forum 2 Nov 8th, 2007 19:14
[SOLVED] Linking php code to a form &amp; mysql database longstand PHP Forum 21 Oct 9th, 2007 16:40
[SOLVED] Bookmarking JS Code! mcdanielnc89 JavaScript Forum 3 Sep 30th, 2007 01:52



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 10:46.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59