Jump to content

unexpected T_STRING in line 20


jeff5656

Recommended Posts

I get Parse error: syntax error, unexpected T_STRING in  with this code.  (Line 20 refers to the create table line)

 

I copied this right from http://snipplr.com/view.php?codeview&id=6637 and there are no comments pointing out any errors, so I am at a loss.

 

here is the code (I have always created tables right in phpmyadmin, so it would be great if I could do it this way because then I can modify the code as I create new tables):

 

CREATE TABLE IF NOT EXISTS states (
  id INT NOT NULL auto_increment,
  name CHAR(40) NOT NULL,
  abbrev CHAR(2) NOT NULL,
  PRIMARY KEY (id)
);

INSERT INTO states VALUES (NULL, 'Alaska', 'AK');
INSERT INTO states VALUES (NULL, 'Alabama', 'AL');

 

and at the end of all those states:

 

INSERT INTO states VALUES (NULL, 'Armed Forces Middle East', 'AE');
INSERT INTO states VALUES (NULL, 'Armed Forces Pacific', 'AP');
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.