PDA

View Full Version : Moving rows?


dniwebdesign
01-11-2004, 08:14 AM
Is there anyway I can move a row off one table to another. For example I'm making an online application form that is stored in MySQL. I want the client I'm making it for to be able to approve the user and then his application is sent to a different table that contains all approved ones. If he isn't his application is removed or moved to a different table. If not this isn't a big deal, I was just wondering if its possible and how easy it would be.

percept
01-11-2004, 08:29 AM
forgive me if I'm wrong cause I'm just a rookie at PHP/MySQL but would this not be just a matter of giving your client an html page with a few choices? Click here to store this application here or click here to store it here?

Then when the selection is made the action calls for a script that will select all data in the row, then insert in into a new table, then delete the initial row?

again, sorry if I'm wrong or there is a better way... just trying to learn this stuff and get more involved...

cheers

dniwebdesign
01-11-2004, 08:44 AM
Could be but I'm just starting to learn PHP and this is going to be one of the most advanced programs I have programmed so far. Any one else know how this would be done, if possible?

Better Example of what I wouldn't mind done:

User Applys
- info stored in app_applications

Admins Accepts Application
- Users application moved to "app_applications_hired"

Admins Doesn't Accept Application
- Users application moved to "app_applications_nothired"


Then possibly if the admin doesn't want the application on the site anymore they can delete it from the table "nothired". The applications will be shown on an HTML page in the form of the application that the admin can print and fax. (There are two options, one being apply online at the moment it just e-mails the info to my client). My client and myself are the admins.

Kiwi
01-11-2004, 01:11 PM
It seems to be a cumbersome way of doing it. I would have one table with applications and one of these fields would be application_status, which would cover the three states you've described. If the database gets too full, then you can set-up a seperate functionality to archive the unwanted applications after a certain time.

If you need additional data for applictions at certain stages, then you can keep these in seperate tables, linked to the application primary key and run a delete when the status is changed.

dniwebdesign
01-11-2004, 07:46 PM
I'll try the extra fields for the status, I think I have an idea that might work, hopefully. Thanks for your input.