|
Posted by Frankly on 06/20/06 19:09
"J.O. Aho" <user@example.net> wrote in message
news:4fqslqF1k82bvU1@individual.net...
> Frankly wrote:
>>>> 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.
>
> http://dev.mysql.com/doc/refman/5.0/en/join.html
>
> SELECT * FROM RelationManagementsBuildings LEFT JOIN (ManagementsTable,
> BuildingTable) ON
> (ManagementTable.ManID=RelationManagementsBuildings.ManID AND
> BuildingTable.BuildingID=RelationManagementsBuildings.BuildingID)
>
> I think the join looks like this, now you would get all the data from both
> ManagementsTable and BuildingTable as if they where all stored in the same
> table.
>
>
> //Aho
First off all thank you once again.
you know what I hate about reading from Dev.mysql is that they keep jumping
from version to verison
in what can and can not be done in the version you have but can be done in
versions I do not have. of course for people smarter than myself this
probably isnt a problem.
i just can not understand why when i am trying to study what i need to do
and what I can not do that they keep bring up different versions. it is very
confusing. it is probably not their fault as the more i see how complicated
this is the more i wonder if i should expect myself to be able to do it. i
probably could learn it given some time to sit down and study.
i am looking at that statement you gave me and even still I dont know where
to put it. the good news is - i just went to my web sites database and yes
the tables i created locally using the admin tool are there. i am at the
RelationManagementsBuildings table structure tab and see a "Run SQL queries
on database myweb_grace.
Below it is a feild that says.
Select * FROM 'RelationManagementsBuildings' WHERE 1. do i delete that and
put in your statement
or do i ad your statement to this one. I am so sorry I need so much help.
my whole life everytime i wanted to learn something i was able to sit down
and teach myself. ok i never done anything like this but i didnt think i
would require so much help. I would understand if you think i should drop
this design and try something more simple. would also like you to contact
me via email if you dont mind. at least i know that user@example.net isnt a
real email :).
i really did think i would do better at this. I would also understand if
after seeing how much help is needed that you think i should stick with
Access and just upload certain feilds from the database as i make changes
and ask people to refresh their browser. Everyting I read leads me to
believe that SQL is the easy part of this project and that scares me.
i do think that there is pre written scripts for php that will be helpful.
dont mind me i am just feeling a little under the weather today. ttyl and
thank you again.
Frank
[Back to original message]
|