Hello list,
I'm pretty new here.

But i already got an problem. I'm working a while with mysql currently
i'm trying to duplicate some entries in my tables.
The problem is, i'm using foreign key constraints between those tables
and i also would like to duplicate the childs.

So i got one big parent, these parent table has some child tables. All
are contatenatet via the FK constraints.
Currently i'm extracting the references by foot. So i do a SHOW TABLE
STATUS FROM akron LIKE '$tablename'.
After that i explode the information an so on. Very dirty stuff, a lot
of code.

And now after all the hard work mysql throws me this when i try to
insert a copy of a parent: Cannot add or update a child row: a foreign
key constraint fails
The childs do exist, but i think my sql syntax is wrong i use: "INSERT
INTO $non_atomar[$i] VALUES ('',$values)"
The key values are right, but i think sql need another syntax to be
happy.

The other thing is, i can solve my problem in this dirty way, but i hope
that there is an easyer way to do this.
Did anyone know an easy way to copy a parent table and all his childs ?
The only thing that changes are the keys.

Kind regards

Fabian Eidner

E  [EMAIL PROTECTED]

B-O-S website  http://www.brotherhood-of-steel.org


Reply via email to