Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Only show specific fields updated in database from form

Posted on 2011-02-24
7
Medium Priority
?
354 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 1000 total points
ID: 34976629
Can you show the code that sends the email to the admin?
0
 
LVL 19

Accepted Solution

by:
Michael701 earned 1000 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

610 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