View Full Version : SQL duplicate row with PHP

11-26-2010, 01:08 AM
I want to make another data of row but the data that i need to add is quite equal to another row

So what can i do to duplicate this row?

11-26-2010, 01:14 AM
If you are referring to a primitive variable data such as an array of primitives, you can simply extract what you want and append, nothing needs to change since they are not references.
If the data is an object, you call a clone $obj to clone it.
If the data is SQL, you can query it, and insert it, or use a SELECT INTO/INSERT SELECT command depending on your database. If its a database that has replicated data aside from the primary key, this is an indication of an un-normalized database and the design itself should be reviewed and changed before further steps are done.