Question
determine which table to get records from
Hi,
I hope I am going about this the right way, if not, I am open to better ways. I have two tables, one is to take requests from the user and another for the edits of those same records, by the admin. Essentially a request table(bcastreq.cfm) and an edit table(editbcastreq.cfm). On the main screen(admin), I have a list of all the requests and a count of all current edits for each individual record. What I need to do is dynamically determine which record to get, and from the correct table. When an admin goes in to select a record they will see that the requests either has edits or does not, indicated by a count. When an admin selects a record to edit, if there has been no edits at all, indicated with a 0 to the selected record it will need to pull the data from the bcastreq table, if there are edits indicated by the count, indicated by a X number it will need to pull the very last edited record for that selection. ex. If the selection currently has 10 edits, I need it to pull that 10th edited record from the edit table to start another edit, which will in turn when finished will create the 11th edit and show accordingly on the main admin screen. If it has zero edits it will need to pull the data from the request table, which will eventually create the first edit. What is the best way to handle this?
I hope I am going about this the right way, if not, I am open to better ways. I have two tables, one is to take requests from the user and another for the edits of those same records, by the admin. Essentially a request table(bcastreq.cfm) and an edit table(editbcastreq.cfm). On the main screen(admin), I have a list of all the requests and a count of all current edits for each individual record. What I need to do is dynamically determine which record to get, and from the correct table. When an admin goes in to select a record they will see that the requests either has edits or does not, indicated by a count. When an admin selects a record to edit, if there has been no edits at all, indicated with a 0 to the selected record it will need to pull the data from the bcastreq table, if there are edits indicated by the count, indicated by a X number it will need to pull the very last edited record for that selection. ex. If the selection currently has 10 edits, I need it to pull that 10th edited record from the edit table to start another edit, which will in turn when finished will create the 11th edit and show accordingly on the main admin screen. If it has zero edits it will need to pull the data from the request table, which will eventually create the first edit. What is the best way to handle this?
