Hi,

I changed my table to InnoDB so one table can be used as foreign key. To do that i had to DELETE the content in my child table. I exported and saved the data on my computer.
1, Now that im trying to import all the data with phpMyAdmin it gives me this error msg.

#1136 - Column count doesn't match value count at row.

2, When i try to insert from a html form it gives me error msg:
"cant insert data because the server unexpectedly dropped the connection."

3, and if i try to insert info through the insert function on PhpMyAdmin i get this error;
#1452 - Cannot add or update a child row: a foreign key constraint fails

Why do i get all this problems. What can be done???

Try removing the foreign key, import the data and then re-create the foreign key and you should be fine. Most of the export/imports scripts I have seen import all of the data first then create the keys at the very end.

Try removing the foreign key, import the data and then re-create the foreign key and you should be fine. Most of the export/imports scripts I have seen import all of the data first then create the keys at the very end.

Hi, ive removed the foreign key but still no luck. i can now insert within phpMyadmin but not from a html form or import. This is very annoying. wonder why my table is messed up.

Log onto the server and look at the MySQL and httpd logs they will tell you why the import and/or web page is not working correctly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.