The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> PHPmyadmin, Innodb, Foreign Keys - How to setup foreign keys in PHPmyadmin
Rating  4
colinkites2000
post Aug 10 2009, 03:52 PM
Post #1


Member
***

Group: Members
Posts: 59
Joined: 11-July 08
Member No.: 6,143



Hello,

I'm trying to setup foreign keys but PHPmyadmin won't give me the option to select innodb. I checked this tutorial http://www.mytechmusings.com/2008/04/using...s-in-mysql.html which is quite good, but the option to select innobd is not there for me. Does this mean my server might not support innodb?

Perhaps I can do this with myisam?

I've have a product table listing products, with an auto-incrementing primary key.

I also have a location table listing where on the website that product will go. IE "index4" would put the product in the 4th table in the index. In this table, I have 3 columns - An auto-incrementing primary key, the product ID and the location. Originally, I had the product ID as the primary key and somehow setup a working relationship but then I was running into problems since the product ID's had duplicates - they were duplicated in order to list the different locations. So then I realized that the primary key should be unique and added an auto-incrementing id column. However, now I cannot get these tables to relate.

1. Do I need to switch to innodb for this application? I don't need referential integrity at this point, maybe it's a good idea though.
2. How can I make these two tables relate through phpmyadmin so that my JOIN will work again?

SELECT products.Range_RPM
FROM products INNER JOIN locations ON locations.Product_Id = products.Product_Id
WHERE locations.Location = 'index4'

Best,
C





User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 04:20 PM