How to insert same row data again getting from field in php

# It Inserts by getting all fields values directly from table and Insert that value like a new record in that table.

It selects that field value first and insert in given field ...

// its selects these fields and get values
SELECT cid,sname  

// it inserts in these fields fetched values.
INSERT INTO demo_table(cid,sname)
# Query will be like::

INSERT INTO demo_table(cid,sname)
SELECT cid,sname
FROM demo_table
WHERE id = 14

Leave a Reply

Your email address will not be published. Required fields are marked *