www.webdeveloper.com
Results 1 to 6 of 6

Thread: PHP/Msql Help!

  1. #1
    Join Date
    Feb 2003
    Location
    PA,USA
    Posts
    37

    Angry PHP/Msql Help!

    Please take a look at this script for a virtual pet shop i cant figure out were the error is please help its included in a zip file
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Could you post the error that you are getting please?

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  3. #3
    Join Date
    Feb 2003
    Location
    PA,USA
    Posts
    37
    Parse error: parse error, expecting `','' or `';'' in /home/codeman/public_html/setroo/shops.php on line 42

  4. #4
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    line 42 looks like this:

    echo "<center><font face=verdana size=4><b>Shop: <?php "$row[shop_name]";?></b></font><br>";

    when it should look like:

    echo "<center><font face=verdana size=4><b>Shop: $row[shop_name]</b></font><br>";

    and you've got a bunch more similar errors...

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  5. #5
    Join Date
    Feb 2003
    Location
    PA,USA
    Posts
    37
    Yea i have an other error and im kinda new to php i fixed a couple i think its on line 52 now if you want u can help out and download it agian the new one
    Attached Files Attached Files

  6. #6
    Join Date
    Nov 2002
    Posts
    411
    man your code's shocking - people dont mind helping out if you're stuck, but i think you'll find people are fairly unwilling to help if you're just too lazy to check your code yourself. The error is telling you which line the problem is on, so have a look at it and see what you're doing with your code. In this case we have:
    PHP Code:
    echo "<center><a href=shops.php?action=buy&id=$row[itemID]&p=$row[item_price]<img 
    src="/setropets/items/<? $row[pic_name?>.jpg"><br>";
    So, where to start.
    You start your echo and open it with quotes, so when it gets to your <img src-" bit it's thinking that the " is closing the echo quote. So you have to slash it out with a \. what that does is tell the php engine that the character that comes next should be ignored by the engine. That way, it echo's out the character but carries on echoing out the line.

    Then for some reason, despite already being in php mode, you try to go into php mode again. The line should read:

    PHP Code:
    echo "<center><a href=shops.php?action=buy&id=$row[itemID]&p=$row[item_price]<img 
    src=\"/setropets/items/
    $row[pic_name].jpg\"><br>"
    I'll warn you that that's not going to help matters much though - you need to just go through, correct each mistake in turn (like for example a few lines later on you have a } for no apparent reason.

    Take more care in your code, and then take the time to look for obvious mistakes when they're pointed out to you by the php engine. And it's not good form to just whack up and entire script and expect someone else to wade through it to spot all your mistakes - come with genuine problems and gripes and you'll get plenty of help.

    Also, you may want to check out www.phpbuilder.com/forum for a dedicated php forum.
    John

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles