About This Ticket

Can’t Setup a Foreign Key

by Joelamite / October 28, 2014, 12:17 am

Hello,

I am working with a database that has three tables that should be related to each other.

I am trying to get just one column of one row to be connected, but no matter what column I modify, I can seem to get the relationship to save.

The tables are InnoDB tables, so I'm not sure what I'm doing wrong.

Thanks for any help you can provide.

Regards,

Joel

Staff

Hi joelamite, 

Could you please shoot me an email at [email protected] with the following details:

- application URL and user/pass
- plesk / cpanel access
- FTP access
- which table/column you're trying to link

Thanks!

Staff

Hi Joel, 

Thanks for the details. Just had a look and somethnig funky is definitely happening with your "wp_crm_people" table, I was not able to add a column and link it properly with the details table.

I'd like to take a closer look at your raw MySQL, however I was not able to access your hosting panel. Could you please verify that the emailed credentials work? Thanks!

Staff

Hi Joel, 

My apologies for the delayed response (we've just released a new product on CodeCanyon over the weekend, so things have been hectic).

I just had another closer look at your issue. First off, I need to clarify how the linking of tables actually takes place. When a column links to another table, the first column takes the value of the primary ID of linked table. So typically this would be a number value (we're working on a solution where a different column from the linked table is displayed, but we're not 100% there yet).

That said, I again proceeded to try and create a new column in your "wp_crm_people" table and link it to the "wp_crm_people_details" table. Now, the relationships works, however due to huge amount of data in the second table, loading and editing records from the first table has become very slow (I assume you're on a shared hosting account? this might slow your MySQL server down a bit as well).

I also took a closer look at yout actual tables and found that both "diabetes" and "wp_events_attendee" are both MyISAM table formats on which linking won't work (the tables need to be stored as InnoDB for linking to work properly).

Staff

Closed due to inactivity