kalster Posted July 2, 2015 Share Posted July 2, 2015 I have noticed that some versions of mysql, the code below needs a ";" at the end of each line while other versions work with a "," and the end of each line. At what version of mysql did that change take place? $mySQL = "alter table users add `username` varchar(20) not null; add `location` varchar(100) not null; "; Link to comment https://forums.phpfreaks.com/topic/297145-alter-table-not-working-for-some-versions-of-mysql/ Share on other sites More sharing options...
requinix Posted July 2, 2015 Share Posted July 2, 2015 That there is not a valid query. What was probably happening was the "username" column was added and everything after the semicolon was ignored. Use a comma. A comma. You would know that if you bothered to learn SQL. $mySQL = "alter table users add `username` varchar(20) not null, add `location` varchar(100) not null "; Link to comment https://forums.phpfreaks.com/topic/297145-alter-table-not-working-for-some-versions-of-mysql/#findComment-1515433 Share on other sites More sharing options...
kalster Posted July 2, 2015 Author Share Posted July 2, 2015 Yes, you are correct, i forgot the mysql syntax. thank you. Link to comment https://forums.phpfreaks.com/topic/297145-alter-table-not-working-for-some-versions-of-mysql/#findComment-1515486 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.