Jump to content

foreign key in php admin


dubfoundry

Recommended Posts

Im currently building an app where user can customize an item upload a photo register and login to an account...so far all those scripts work great..

 

Now i need to have all the cust info pulled from multiple tables using an id reference so it can be displayed on the member area page. (whats the php/mysql script for this by the way?)

 

They are 3 tables in the database user,products and prd_order... in the user table there is a id(primaryKey) field and the prd_order table have an userid(set as an index) field in it.... I need both to be linked so that a new user auto links to his product choice in the prd_order table.

 

So i converted both tables to InnoDB and attempted to link both via the relational view panel

i got this error--

 

 

Error

 

SQL query:

 

ALTER TABLE `prd_order` ADD FOREIGN KEY ( `user_id` ) REFERENCES `imagecon`.`user` (

`id`

)

 

MySQL said: Documentation

#1216 - Cannot add or update a child row: a foreign key constraint fails

 

so im stuck..whats the work around....

 

 

 

Is it possible to reffer to and link both fields with out a foreign key. can you pull from multiple tables without using a foreign key?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/136596-foreign-key-in-php-admin/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.