You are here: Re: Learning php Sql « PHP SQL « IT news, forums, messages
Re: Learning php Sql

Posted by Frankly on 10/13/51 11:48

"J.O. Aho" <user@example.net> wrote in message
news:4dktv7F19ti0cU1@individual.net...
> Frankly wrote:
>> "Frankly" <NotReal@yahoo.com> wrote in message news:...
>> I have now created 4 almost 5 tables.
>>
>> the ManagementBuildings table shows as 2 tables - I think that is
>> because of
>> 2 primary keys?
>>
>> I am now on the apartments table and for some reason I can not complete
>> it.
>> I know the structure of the this and the other tables still needs to be
>> tuned - but why
>> this.. it didnt happen on any of my other tables :(
>>
>> SQL query:
>>
>> CREATE TABLE `Apartments` (
>>
>> `ApartmentID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
>> `Rent` INT NOT NULL ,
>> `Bedrooms` INT NOT NULL ,
>> `ApartmentNumber` VARCHAR( 10 ) NOT NULL ,
>> `MoveInDate` DATE NOT NULL ,
>> `StillAvailable` ENUM NOT NULL ,
>> `ApartmentContact` CHAR( 20 ) NOT NULL ,<----- this is where the problem
>> is?.
>> `ApartmentPhone` VARCHAR( 12 ) NOT NULL ,
>> `Picture1` VARCHAR( 50 ) NOT NULL ,
>> `Picture2` VARCHAR( 50 ) NOT NULL ,
>> `Picture3` VARCHAR( 50 ) NOT NULL ,
>> INDEX ( `Rent` )
>> ) TYPE = 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, `ApartmentContact` CHAR(20) NOT NULL, `ApartmentPhone
>
> The problem lies before the 'NOT NULL, `ApartmentContact` CHAR(20) NOT
> NULL, `ApartmentPhone', with other words the ENUM after `StillAvailable`,
> I would choose to use INT(1) where default is 1 and if not available then
> set it to 0.
>
> as IF(1) results in a true and IF(0) results in false.
>
> If you still want to struggle with ENUM, then take a look here
> http://dev.mysql.com/doc/refman/5.0/en/enum.html
>
> You may run into problems with the type CHAR later on too, I would choose
> to use VARCHAR instead.
>
>
> //Aho

Hello.

I just dowloaded and did a few tutorials on ms visual web developer 2005
express.
seems like a great tool. but i am like the whole PHP thing. I dont really
know why and i am to tired to think.

thank you for helping me under stand that error message. I should have
picked up on the before "NULL" thing.
I wanted to ask this group about the whole varchar vs char thing. faster
searching vs smaller file size.
I have also done enum in tutorials. imto tired right now to try i am going
to bed and will try when i wake up.
i also found out today that the current version of MySQL isnt free. so i am
just a point or 2 away from the current free version. lol its 4:42 am.

--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация