Solved

index not defined error when creating foreign key

Posted on 2014-04-06
7
894 Views
Last Modified: 2014-04-16
I am managing mysql 5.6 with phpMyadmin 2.8.1 which are hosted by IPower (web hosting company).

I have created 2 tables and have set them up as InnoDB.

The tables created names are: users and patient_id.

In the patient_id table I have added a column to be used as the foreign key that will be related to the "id" column in the users table.

I have indexed this column in the patient_id table.

When I go into the relationship view of the table and try to setup the relationship , I get "No Index found for the column" even though I have indexed it already!

I have attached screenshots of the database structure and the error message.

Any help will be greatly appreciated! Thanks
Q-28406140.png
0
Comment
Question by:LuiLui77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
7 Comments
 

Author Comment

by:LuiLui77
ID: 39981516
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39982142
Can you post the designer view of your database?
You can get it by clicking on the database name on the left, then clicking on "Designer".
See image.
designer view
0
 
LVL 14

Expert Comment

by:dejaanbu
ID: 39982176
this may help

detailed info
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:LuiLui77
ID: 39983526
I don't have Designer available on phpMyadmin, so I had to draw it in excel en posted it as a picture.
Tables-relationship.png
0
 

Accepted Solution

by:
LuiLui77 earned 0 total points
ID: 39994337
I ended up on creating the tables on a test mysql server and setting up the relationship, then I exported the database and imported it into the production server. Now the tables are related.

Thank you.
0
 

Author Closing Comment

by:LuiLui77
ID: 40003497
Not a real solution but a good workaround that fixed my issue.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Creating and Managing Databases with phpMyAdmin in cPanel.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question