Solved

Only show specific fields updated in database from form

Posted on 2011-02-24
7
349 Views
Last Modified: 2012-05-11
I have a form someone can fill out to be listed on a website. The user submits their data and an email is sent to admin for approval. Admin approves it and the listings is added to the website.

If the user comes in and updates a couple of fields and submits it to the admin again - we have the listing coming off the site until the admin can approve the changes. Question is - is there a way when the admin goes in - to see the fields that were updated so they know what to look for? Maybe make them a different color?
0
Comment
Question by:katlees
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 11

Assisted Solution

by:Bruce Smith
Bruce Smith earned 250 total points
ID: 34976629
Can you show the code that sends the email to the admin?
0
 
LVL 19

Accepted Solution

by:
Michael701 earned 250 total points
ID: 34976638
What you don't want to do is remove the previous approved data just because they submitted a change request.

Write the changed fields to a separate table. then it will be easy to display the current data with the requested changes.
0
 
LVL 11

Expert Comment

by:Bruce Smith
ID: 34976676
Hence my request for code. Whether to see if it's coming from a pending table or the actual user table. Either way, there should be a way to differentiate between the previously approved data and the updated data. Being able to see the code would help to provide a specific solution.

Cheers
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:katlees
ID: 34979924
That basically answers my question. I have to write to a seperate table to show changes then compare the temporary table with the live table to see if they match or not. If they don't, show in a different color.

Thanks!
0
 

Author Closing Comment

by:katlees
ID: 34979931
Thanks guys. You answered my question just from your comments. I'll see what I can do with the seperate tables.
0
 
LVL 11

Expert Comment

by:Bruce Smith
ID: 34980419
Another option is to create a new varchar field in the user table called something like 'pending_field_changes' and then input the updated fields and their values as a delimited string of some kind. So if the user table looks like this:

user_id
user_name
user_email
user_phone
pending_field_changes

And the user updates his email and phone, you could write the query like so:
UPDATE user SET pending_field_changes = 'user_phone~555-444-3333|user_email~email@server.com' 
WHERE user_id = 'some_id';

Open in new window

And then when you pull the pending information out you could explode the string by the '|' character and then you could get the column name from each of those by exploding them by the '~' character.

I hope this makes sense. You can do this which is fairly simple, or you could just create a temp table.

Cheers
0
 

Author Comment

by:katlees
ID: 34980543
PatSmitty - if we did that, if the changes are accepted - how do we move the changes to the correct fields?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
reverse engineer .sql from php files 11 54
PHP SMTP authentication 6 30
CSRF session and form tokens never match when using php/AJAX 4 31
Find RGB colors from a screen. 2 20
This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question