486974 Posted September 30, 2007 Share Posted September 30, 2007 Hi i am using a tutorial on membership site (php freaks) have followed what they put in the columns and come up with errors saying i cant have not null with text i tried changing it to null but got the same error message Error SQL query: CREATE TABLE `members` ( `id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `username` VARCHAR( 15 ) NOT NULL , `encryptpass` VARCHAR( 255 ) NOT NULL , `password` VARCHAR( 15 ) NOT NULL , `name` VARCHAR( 255 ) NOT NULL , `prov` ENUM NOT NULL , `style` TINYTEXT NOT NULL , `hist` TEXT NOT NULL , `open` TEXT NOT NULL , `webs` VARCHAR( 255 ) NOT NULL DEFAULT '"http://"', `email` VARCHAR( 255 ) NOT NULL , `photo` VARCHAR( 255 ) NOT NULL DEFAULT '"nopic.jpg"', `signupdate` DATETIME NOT NULL DEFAULT '"now()"', UNIQUE ( `username` ) ) ENGINE = MYISAM MySQL said: #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 'NOT NULL, `style` TINYTEXT NOT NULL, `hist` TEXT NOT NULL, `open` TEXT NOT NULL,' at line 1 Please help Rob Quote Link to comment https://forums.phpfreaks.com/topic/71292-solved-trouble-with-mysql/ Share on other sites More sharing options...
MadTechie Posted September 30, 2007 Share Posted September 30, 2007 The ENUM is wrong try this CREATE TABLE `members` ( `id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `username` VARCHAR( 15 ) NOT NULL , `encryptpass` VARCHAR( 255 ) NOT NULL , `password` VARCHAR( 15 ) NOT NULL , `name` VARCHAR( 255 ) NOT NULL , `prov` ENUM('small', 'medium', 'large') NOT NULL , `style` TINYTEXT NOT NULL , `hist` TEXT NOT NULL , `open` TEXT NOT NULL , `webs` VARCHAR( 255 ) NOT NULL DEFAULT 'http://', `email` VARCHAR( 255 ) NOT NULL , `photo` VARCHAR( 255 ) NOT NULL DEFAULT 'nopic.jpg', `signupdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE = MYISAM Note: update the prov (ENUM) to the correct data i also updated the `signupdate` & the ID Quote Link to comment https://forums.phpfreaks.com/topic/71292-solved-trouble-with-mysql/#findComment-358636 Share on other sites More sharing options...
486974 Posted September 30, 2007 Author Share Posted September 30, 2007 I am still getting the same error Error SQL query: CREATE TABLE `members` ( `id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `username` VARCHAR( 15 ) NOT NULL , `encryptpass` VARCHAR( 255 ) NOT NULL , `password` VARCHAR( 15 ) NOT NULL , `name` VARCHAR( 255 ) NOT NULL , `prov` ENUM NOT NULL COMMENT '(''small'', ''medium'', ''large'')', `style` TINYTEXT NOT NULL , `hist` TEXT NOT NULL , `open` TEXT NOT NULL , `webs` VARCHAR( 255 ) NOT NULL DEFAULT '"http://"', `email` VARCHAR( 255 ) NOT NULL , `photo` VARCHAR( 255 ) NOT NULL DEFAULT '"nopic.jpg"', `signupdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , UNIQUE ( `username` ) ) ENGINE = MYISAM MySQL said: #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 'NOT NULL COMMENT '(''small'', ''medium'', ''large'')', `style` TINYTEXT NOT NULL' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/71292-solved-trouble-with-mysql/#findComment-358645 Share on other sites More sharing options...
shocker-z Posted September 30, 2007 Share Posted September 30, 2007 You must have copied it wrong because i copied what you just pout and got error but when i copy madtechies it works thas works for me CREATE TABLE `members` ( `id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `username` VARCHAR( 15 ) NOT NULL , `encryptpass` VARCHAR( 255 ) NOT NULL , `password` VARCHAR( 15 ) NOT NULL , `name` VARCHAR( 255 ) NOT NULL , `prov` ENUM('small', 'medium', 'large') NOT NULL , `style` TINYTEXT NOT NULL , `hist` TEXT NOT NULL , `open` TEXT NOT NULL , `webs` VARCHAR( 255 ) NOT NULL DEFAULT 'http://', `email` VARCHAR( 255 ) NOT NULL , `photo` VARCHAR( 255 ) NOT NULL DEFAULT 'nopic.jpg', `signupdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE = MYISAM you added UNIQUE ( `username` ) Liam Quote Link to comment https://forums.phpfreaks.com/topic/71292-solved-trouble-with-mysql/#findComment-358647 Share on other sites More sharing options...
486974 Posted September 30, 2007 Author Share Posted September 30, 2007 Thats what php admin produced isnt that the same as yours i dont understand what i have done wrong CREATE TABLE `members` ( `id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `username` VARCHAR( 15 ) NOT NULL , `encryptpass` VARCHAR( 255 ) NOT NULL , `password` VARCHAR( 15 ) NOT NULL , `name` VARCHAR( 255 ) NOT NULL , `prov` ENUM NOT NULL COMMENT '("small", "medium", "large")', `style` TINYTEXT NOT NULL , `hist` TEXT NOT NULL , `open` TEXT NOT NULL , `webs` VARCHAR( 255 ) NOT NULL DEFAULT '"http://"', `email` VARCHAR( 255 ) NOT NULL , `photo` VARCHAR( 255 ) NOT NULL DEFAULT '"nopic.jpg"', `signupdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE = MYISAM MySQL said: #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 'NOT NULL COMMENT '("small", "medium", "large")', `style` TINYTEXT NOT NULL, `his' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/71292-solved-trouble-with-mysql/#findComment-358654 Share on other sites More sharing options...
shocker-z Posted September 30, 2007 Share Posted September 30, 2007 http://www.ukchat.ws/createmembers.txt use that as somthing must be changing.. failing that download mysql query browser and run the quiery in that as the code your pasting back isn't the same as were pasting in. Regards Liam Quote Link to comment https://forums.phpfreaks.com/topic/71292-solved-trouble-with-mysql/#findComment-358659 Share on other sites More sharing options...
MadTechie Posted September 30, 2007 Share Posted September 30, 2007 POST the EXACT code i have below in PMA's SQL section it should work.. i'll note again the ENUM('small', 'medium', 'large') was made up.. this will need to be changed to suite ie ENUM('UK', 'US', 'Europe') or whatever its used for.. the reason yours failed it because you tried to add the list in to the comments..! The ENUM is wrong try this CREATE TABLE `members` ( `id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `username` VARCHAR( 15 ) NOT NULL , `encryptpass` VARCHAR( 255 ) NOT NULL , `password` VARCHAR( 15 ) NOT NULL , `name` VARCHAR( 255 ) NOT NULL , `prov` ENUM('small', 'medium', 'large') NOT NULL , `style` TINYTEXT NOT NULL , `hist` TEXT NOT NULL , `open` TEXT NOT NULL , `webs` VARCHAR( 255 ) NOT NULL DEFAULT 'http://', `email` VARCHAR( 255 ) NOT NULL , `photo` VARCHAR( 255 ) NOT NULL DEFAULT 'nopic.jpg', `signupdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE = MYISAM Note: update the prov (ENUM) to the correct data i also updated the `signupdate` & the ID Quote Link to comment https://forums.phpfreaks.com/topic/71292-solved-trouble-with-mysql/#findComment-358667 Share on other sites More sharing options...
486974 Posted September 30, 2007 Author Share Posted September 30, 2007 Thank you so much Quote Link to comment https://forums.phpfreaks.com/topic/71292-solved-trouble-with-mysql/#findComment-358675 Share on other sites More sharing options...
MadTechie Posted September 30, 2007 Share Posted September 30, 2007 Extra Info.. your need to change the prov later so.. via PMA, select the prov field and click edit (change), Now in the length/value will appear as 'small','medium','large' change to what you need ie 'US','UK','Europe','Blar','etc' Hope all goes well, if you have more problems include a link to the tutorial so we can see what "should" happen Quote Link to comment https://forums.phpfreaks.com/topic/71292-solved-trouble-with-mysql/#findComment-358681 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.