copy info from one field to another

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

copy info from one field to another

Post by pleigh »

is there a way that i can copy an info from, for example, i have 3 date fields namely:

date previousdate postupdate
----- -------------- *******

is there a way that i can update the field previousdate and copy the content of the postupdate, in this case, i want to copy the asterisks to previousdate then update new postupdate?
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Code: Select all

UPDATE tablename SET  postupdate=previousdate WHERE condition;
Should work (Need a condition such as "id=X" or would update all rows).
Post Reply