|
Posted by Frankly on 06/20/06 17:32
what I dont understand is what cant I create a 1 to many relationship
with managements and buildings with out using a linking table.
Managements can have many buildings but buildings cant have many
managements.
same thing for apartments. a building can have many aparments but
apartments cant have many buildings.
i know your way is better but perhaps it would be easier for someone with
my skill level to do it that way. I was just in access and created the
relations using the linking table very easily. I am sure it will have some
limits but at this point i think it might be better to have a limited data
driven web site for my busy season and then in the winter work on making a
better database. i just dont know what to do anymore. maybe this thing is
beyond me.
--
Frank
PHPmySQL1@yahoo.com
"Frankly" <PHPmySQL1@yahoo.com> wrote in message
news:7OVlg.3720$VF.341@trndny03...
> no matter what i try i keep getting
> mysql error 1005 and errno:150. i read alot about this error and can not
> see where it applies
> to what I am doing wrong.
> both tables are Innodb, both are set the same, it seems in MySQL
> Administrator once you make a key primary it becomes indexed. very
> fustrating.
>
> --
>
> Frank
> PHPmySQL1@yahoo.com
> "Frankly" <PHPmySQL1@yahoo.com> wrote in message
> news:t4Nlg.2360$ia6.1199@trndny09...
>>
>>
>> its just about 3am here. I was having a hard time sleeping so i figured
>> i
>> would give this another shot.
>>
>> CREATE DATABASE `myweb325573_grace`;
>>
>> DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
>>
>> CREATE TABLE `RelationManagementsBuildings` (
>>
>> `ManID` int(10) unsigned NOT NULL default '0',
>>
>> `BuildingID` int(10) unsigned NOT NULL default '0',
>>
>> PRIMARY KEY (`ManID`,`BuildingID`),
>>
>> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
>> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
>>
>> ) TYPE=InnoDB ROW_FORMAT=DYNAMIC;
>>
>>
>>
>> i think this is wrong because it was created in the ManagementsBuildings
>> table and used
>>
>> the primary keys in the other tables as foreign.
>>
>>
>>
>>
>>
>> o well it the admin crashed because i picked the wrong table ok ok i
>> tried
>> to create a relation for the relation table to the relation table lol
>> duh..
>> i realized it as soon as i pressed the button. well my foot fell asleep
>> big
>> time and its bothering me. time to try sleep once again. 3:01am see
>> you
>> in 5 hours hope i get at least 4 hours. it dont look good.
>>
>>
>>
>> Frank
>>
>>
>>
>
>
[Back to original message]
|