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
https://forums.phpfreaks.com/topic/208044-unexpected-t_string-in-line-20/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.