|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Moving data from 1 table to another
I will try to explain this the best that I can.
I would like to move my news to archives, then delete the old article from the news table. I have 2 mysql tables, 1 contains news [id, date, content,] the other is just the same but name archives. I list the news in a admin section, Next to each news ID there's a URL, [ move.php?=$id ] If I choose that news ID, it would then be moved to the archives table and then be deleted from the regular news table. I have no idea where to start on doing this, Please Help :-) |
|
#2
|
|||
|
|||
|
Why not just add another column to the current news table, entitled "archive".
Put in '1' if it's archived, and '0' if it isn't. (Set default of 'archive' to '0'). When viewing current news, just do a "SELECT * FROM `news` WHERE `archive` = '0'", and you should get your desired results. |
|
#3
|
|||
|
|||
|
I didn't think about that, Thanks
Instead of moving the data just edit it to another category... Thanks again :-) |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Moving data from 1 table to another |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|