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

2003-01-21 Thread David Rice

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` 
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



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

2003-01-21 Thread Hutchins, Richard
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:[EMAIL PROTECTED]]
 Sent: Tuesday, January 21, 2003 10:11 AM
 To: [EMAIL PROTECTED]
 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` 
 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
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php