1

I am working on a site with EE where the client is having some of the data pushed into to the MySQL database from a external FilemakerPro database. I'm working with an external company who handle the clients database for them and in order to push the data through they need to know how the exp_channel_data table allocates it's primary key. Apparently looking at the setting in MySQL, it's the only pertinent table which doesn't do it automatically.

Could anyone shed any light on this? Many thanks.

1 Answer 1

1

The primary key for entries are generated in the exp_channel_titles table. When the entry is created the data first goes there and then it inserts into the exp_channel_data table using the same key.

Edit: In Api_channel_entries.php these two functions are called:

ee()->db->insert('channel_titles', $meta);
$this->entry_id = ee()->db->insert_id();

ee()->db->insert_id() is a link to code igniter's mysql function that is a call to the php function mysql_insert_id() (or your other types of databases' function call). After that call in api_channel_entries, it uses that id to insert all the data into the channel entries table.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.