Ask for a basic MySQL problem.:( PHP) copy a record with ID A into the same table, generate a new record, modify the values of some fields in the process, how to write?
This is the case:
The user copies an already published item and then publishes it as part of the change.
Only content that is likely to be modified is submitted at the time of publication, and other content is obtained from the database directly based on the ID of the copied record
Ask the SQL statement how to write online do not know how to search .... MySQL PHP Enquiry Copy
------Solution--------------------
The format is as follows
INSERT into user_list (username, ' password ', ' status ') SELECT ' asfasfasf ', ' Password ', ' status ' from User_list WHERE id=2
Red Part originally is username, if do not want id=2 username, change to ASFASFASF can
------Solution--------------------
References: The
format is as follows
INSERT into user_list (username, ' password ', ' status ') SELECT ' asfasfasf ', ' Password ', ' status ' from User_list WHERE id=2
Red Part originally is username, if do not want id=2 username, change to ASFASFASF can
...
++
Change the SQL statement to what you want to change.
------Solution--------------------
Using SQL statements
Insert into table (field) Select field from table condition