confused...linking?

you know the way in access, you can link tables to ensure that a value cannot be entered in table 2 unless it exists in table one?
how would you do that with php and mysql?

sorry if this is a stupid question…

I don’t believe you can do that directly in MySQL. You have to remember. You are writing the interface for the MySQL database. Access, is just a program that reads .mdb files. So, in reality, all you are doing with PHP and MySQL is making a interface with PHP. You are writing your own ACCESS program.

If you need to visually see the relations in the database, go to mysql and download the Workbench (http://www.mysql.com/products/workbench/). Note though, this does not mean the tables will be linked. It will create indexes which makes the database run much faster. The program is great for laying out the databases in a visual format and linking the tables together. It will also export the diagram as SQL code so you can run the code and make the database exactly the way you want it.

Actually MySQL can do this if it’s what I think you want.

You are talking about a “Constraints” Have a look at http://dev.mysql.com/doc/refman/5.0/en/ … aints.html

I think that may help.

Sponsor our Newsletter | Privacy Policy | Terms of Service