RE: [PHP-DB] MySql DB, help, sql error and i don't know why

From: Date: Tue, 21 Jan 2003 15:19:22 +0000
Subject: RE: [PHP-DB] MySql DB, help, sql error and i don't know why
Groups: php.db 
Request: Send a blank email to php-db+get-25007@lists.php.net to get a copy of this message
I'm pretty sure that the error is because you're not able to set a length for the TEXT column type. I checked the MySQL manual and it does not show a prototype with that optional parameter. Besides, if you want a TEXT of (255), why not just use a VARCHAR (255)? They're essentially the same thing and you can GROUP BY or ORDER BY on the VARCHAR without any conversion. > -----Original Message----- > From: David Rice [mailto:haloplayer@hotmail.com] > Sent: Tuesday, January 21, 2003 10:11 AM > To: php-db@lists.php.net > Subject: [PHP-DB] MySql DB, help, sql error and i don't know why > > > > SQL-query : > > CREATE TABLE staff ( > > StaffId INT( 4 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , > Name VARCHAR( 30 ) NOT NULL , > Surname VARCHAR( 30 ) NOT NULL , > Address TEXT( 225 ) NOT NULL , > JobId SMALLINT( 2 ) NOT NULL , > PermissionId SMALLINT( 2 ) NOT NULL , > HomePhone INT( 11 ) NOT NULL , > MobilePhone INT( 11 ) NOT NULL , > TipsPoints INT( 1 ) NOT NULL , > DOB DATE NOT NULL , > Password VARCHAR( 20 ) NOT NULL , > ResterauntId INT( 1 ) NOT NULL , > DateStarted DATE NOT NULL , > StaffStatusId TINYINT( 1 ) NOT NULL > ) > > MySQL said: > > > You have an error in your SQL syntax near '(225) NOT NULL, JobId±þñ)ª > Öˆ0HÀ…õ > SMALLINT(2) NOT NULL, PermissionId SMALLINT(2) NOT NUL' at > line 1 > > > > > > > _________________________________________________________________ > MSN 8: advanced junk mail protection and 2 months FREE*. > http://join.msn.com/?page=features/junkmail > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.db (#25007) next »