Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: SQL duplicate row with PHP
11-26-2010, 12:08 AM #1
- Join Date
- Dec 2009
- Thanked 1 Time in 1 Post
SQL duplicate row with PHP
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, 12:14 AM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,660 Times in 2,629 Posts
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 $objto 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.
header('HTTP/1.1 420 Enhance Your Calm');
Users who have thanked Fou-Lu for this post: