Solved

index not defined error when creating foreign key

Posted on 2014-04-06
7
889 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
  • 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

735 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