|
#1
|
|||
|
|||
|
help with phpmyadmin please
Hi I am creating a website and linking it to a database using php and mysql. I need to create the databses in phpmyadmin and have decided on the structure of the tables in the database. However, as expected, there are foreign keys in some of the tables - does anyone know how to link the foreign key of one table into another table within phpmyadmin so the database works properly and can be queried using sql? Is it a case of using an sql command to alter the table? I would really appreciate help with this.
Thanks, James |
|
#2
|
||||
|
||||
|
Welcome
![]() There is a SQL/Query window in phpmyadmin where you can directly enter the SQL code.
__________________
Cheers, Degs Please post back with your results CTH Terms of Use CTH Subscriptions :: Adaware Guide :: HijackThis |
|
#3
|
|||
|
|||
|
Thanks - any ideas on the SQL to use?
|
|
#4
|
||||
|
||||
|
I'm not great on SQL.
Could you give an example of your table names and what you want to achieve?
__________________
Cheers, Degs Please post back with your results CTH Terms of Use CTH Subscriptions :: Adaware Guide :: HijackThis |
|
#5
|
|||
|
|||
|
I've never specified relationships explicitly in MySQL/PHPMyAdmin, I do that when I come to query the database by making sure that the two are equal in the where clause.
So for a db with a table called people with primary key id and a table answers where people.id is a foreign key I might do select p.firstname, p.lastname, a.q1answer from people p, answers a where p.id=a.id;
__________________
Don't forget to post back with the results |
![]() |
| Bookmarks |
«
Previous Topic
|
Next Topic
»
| Topic Tools | |
|
|
All times are GMT +1. The time now is 09:19 AM.
[
RSS ]









