WEB MySQL\PHP halp!

Discussion in 'OT Technology' started by brujito, Nov 25, 2009.

  1. brujito

    brujito New Member

    Joined:
    Aug 10, 2004
    Messages:
    366
    Likes Received:
    0
    I'm trying to learn me some mysql\php but this just has me stumped.

    Im following the tizag.com tutorial and so everything was ok but when we got to the the INSERT INTO tut and the code keeps throwing this error:

    Parse error: parse error, expecting `','' or `';'' in C:\wamp\www\sqltuts\day2.php on line 8

    The code is
    mysql_query("INSERT INTO example (firstname, lastname, name) VALUES ('Timmy', 'Mellowman', '[email protected]' ) ");

    All I did was change the column names and tried adding the , and ; where I thought logical. Its running on WAMP (mysql 5.1.36 and PHP 5.2.9-2).

    Any help is appreciated.
     
  2. Ricky

    Ricky █▄ █▄█ █▄ ▀█▄

    Joined:
    Jun 17, 2005
    Messages:
    38,767
    Likes Received:
    6
    mysql_query ("INSERT INTO example (firstname, lastname, name) VALUES ('Timmy', 'Mellowman', '[email protected]')");

    i just retyped it and it looks exactly like yours.
    hmm that doesnt work? hmmm

    are you sure its line 8?
     
  3. 96

    96 Merry Christmas :D

    Joined:
    Oct 30, 2001
    Messages:
    16,073
    Likes Received:
    0
    Location:
    San Diego
    Yeah, I don't think that line is a problem.

    Post the code around the insert?
     
  4. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    Is there an line break instead of line wrap in there?? I've had that happen dozens of times.
     
  5. brujito

    brujito New Member

    Joined:
    Aug 10, 2004
    Messages:
    366
    Likes Received:
    0
    DOH! I left out a ; on the previous line. Thanks guys!
     
  6. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,642
    Likes Received:
    13
    Location:
    Atlanta
    Damnit, i was going to say that if you forget the semicolon on the line before, it'll throw an error.
     

Share This Page