Code: Select all
WHERE names.namesID = phone.phoneIDCode: Select all
WHERE names.namesID = phone.namesIDModerator: General Moderators
Code: Select all
WHERE names.namesID = phone.phoneIDCode: Select all
WHERE names.namesID = phone.namesID

The relationship in the MySQL database is the same as the relationship in the Access database. My guess is that there is something about the way Access presents things that is obscuring some details from you. Microsoft likes to do things magically so users become dependent on its products. Or maybe the way phpMyAdmin presents things is what is confusing.cybershot wrote:You can see that there is a relationship between the primary key in the names table and the foreign key in the phone table.
The problem I am having in phpmyadmin is that there doesn't seem to be that relationship even though I am defining it.
If you don't specify a value for the phone.namesID field when inserting a new row in the phone table, the default value will be used. If the default value is NULL, it will not match the primary key of any rows in the names table.cybershot wrote:the namesID field in the phone table shows up as null. I would think that it should have an index in it that matches to the names table.
Do you have an Access query that does that? This is one of those cases where Access magically simplifies things at the expense of your education. If you have the Access query, examine it in SQL View. The SQL you see there is very similar to the SQL you need to use in MySQL. Now, (still in Access) delete the relationship between the tables. Go back to the query and notice that the results have not changed. Conclude that defining a relationship has nothing to do with the results of a given SELECT query.cybershot wrote:I don't want to do a query for all of them, I want to do a query for name and have it return all the other information based on foreign keys.