webguync Posted January 5, 2011 Share Posted January 5, 2011 Hi, I am trying to create we table by copying and pasting the following into PHPMyAdmin. Not sure why, but I get a MySQL error. //Comments Table CREATE TABLE comments ( com_id INT PRIMARY KEY AUTO_INCREMENT, com_name VARCHAR(100), com_email VARCHAR(100), com_dis TEXT, post_id_fk INT, FOREIGN KEY(post_id_fk) REFERENCES posts(post_id) ); anyone know why? Quote Link to comment https://forums.phpfreaks.com/topic/223504-not-sure-why-i-am-getting-an-error-with-this-sql/ Share on other sites More sharing options...
Maq Posted January 5, 2011 Share Posted January 5, 2011 What's the error? Quote Link to comment https://forums.phpfreaks.com/topic/223504-not-sure-why-i-am-getting-an-error-with-this-sql/#findComment-1155309 Share on other sites More sharing options...
webguync Posted January 5, 2011 Author Share Posted January 5, 2011 #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '//Comments Table CREATE TABLE comments ( com_id INT PRIMARY KEY AUTO_INCREMEN' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/223504-not-sure-why-i-am-getting-an-error-with-this-sql/#findComment-1155312 Share on other sites More sharing options...
Maq Posted January 5, 2011 Share Posted January 5, 2011 Are you including '//Comments Table' when you execute the SQL? Quote Link to comment https://forums.phpfreaks.com/topic/223504-not-sure-why-i-am-getting-an-error-with-this-sql/#findComment-1155320 Share on other sites More sharing options...
webguync Posted January 5, 2011 Author Share Posted January 5, 2011 oh, ok. Thought comments got ignored. Guess not! Quote Link to comment https://forums.phpfreaks.com/topic/223504-not-sure-why-i-am-getting-an-error-with-this-sql/#findComment-1155323 Share on other sites More sharing options...
Maq Posted January 5, 2011 Share Posted January 5, 2011 oh, ok. Thought comments got ignored. Guess not! I'm pretty sure that's what is causing your error. Take it out and let me know. Quote Link to comment https://forums.phpfreaks.com/topic/223504-not-sure-why-i-am-getting-an-error-with-this-sql/#findComment-1155325 Share on other sites More sharing options...
webguync Posted January 5, 2011 Author Share Posted January 5, 2011 yes, it works now. Quote Link to comment https://forums.phpfreaks.com/topic/223504-not-sure-why-i-am-getting-an-error-with-this-sql/#findComment-1155326 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.