Jump to content


Photo

How to create foreign key in PHPMyAdmin?


  • Please log in to reply
4 replies to this topic

#1 angelali

angelali

    Advanced Member

  • Members
  • PipPipPip
  • 128 posts

Posted 14 May 2012 - 05:26 AM

I am having a big problem creating foreign key on PHPMyAdmin. I saw many people having this problem... Never I did this before, so I tried but could not figure out... In Microsoft Access, you do it directly, but on PHPMyAdmin, its a bit complicated..

I have two tables, as follows:

User
-user_id (Primary key)
-name
-age
-country

Job
-job_id (Primary key)
-job_name
-job_place

What I want is to make user_id as foreign key in Job table.

Can you explain me how to do it with the GUI PHPMyAdmin instead of query?

#2 ignace

ignace

    Now mod flavored

  • Moderators
  • 6,239 posts
  • LocationBelgium

Posted 14 May 2012 - 12:11 PM

see here create a foreign key in phpmyadmin

#3 scootstah

scootstah

    Advanced Member

  • Gurus
  • 2,889 posts
  • LocationUSA

Posted 16 May 2012 - 07:11 PM

Click a table, then click Structure, then click Relation View.
while(!$succeed = try());

#4 FoxRocks

FoxRocks

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 15 November 2012 - 06:54 AM

see here create a foreign key in phpmyadmin


For your information, I actually DID Google it and I got this thread as result.

I guess there's gotta be a douchebag on every forum, congratulations, you win!

#5 ignace

ignace

    Now mod flavored

  • Moderators
  • 6,239 posts
  • LocationBelgium

Posted 15 November 2012 - 02:00 PM

And you are the idiot who posted in a topic that hasn't had a reply in over 6 months. We all have our defects, right?

Edited by ignace, 15 November 2012 - 02:01 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com