|
Posted by Frankly on 06/20/06 17:37
>> CREATE DATABASE `myweb325573_grace`;
>
> This creates the database itself, you don't need this at this moment, as
> it's already created.
>
>
>> DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
>
> This removes the table RelationManagementsBuildings, if it already exists
> in the database.
>
those are just statements that were included when i copied the SQL.
>
>> CREATE TABLE `RelationManagementsBuildings` (
>>
>> `ManID` int(10) unsigned NOT NULL default '0',
>>
>> `BuildingID` int(10) unsigned NOT NULL default '0',
>>
>> PRIMARY KEY (`ManID`,`BuildingID`),
>
> This seems okey.
>
>> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
>> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
>
> Haven't used Constraints and cascades, I guess I should read on them, but
> the part here you could drop without it affecting the main functionality
> of the table, if you remove this, don't forget to remove the comma after
> the definition of the primary keys.
but isnt this the part the creates the actual join? this is where I am
having trouble. i did that one fine
but when i try to make the join using the 2nd part of the primary key which
is Buildings and make the join with the buildings table is when i get the
mysql error 1005 (errno:150) if i dont need this join than my tables are
complete. lol at least i think they are.
Frank
>
>
> Haven't slept much myself tonight, so I will be off early today.
>
>
> //Aho
Navigation:
[Reply to this message]
|