jeff5656 Posted July 17, 2010 Share Posted July 17, 2010 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'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/208044-unexpected-t_string-in-line-20/ Share on other sites More sharing options...
Alex Posted July 17, 2010 Share Posted July 17, 2010 That's not PHP. That's what you should be running in phpmyadmin to create the table and insert the records. Quote Link to comment https://forums.phpfreaks.com/topic/208044-unexpected-t_string-in-line-20/#findComment-1087520 Share on other sites More sharing options...
jeff5656 Posted July 17, 2010 Author Share Posted July 17, 2010 Aha...I see thank you! Quote Link to comment https://forums.phpfreaks.com/topic/208044-unexpected-t_string-in-line-20/#findComment-1087523 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.