?
Solved

HOW TO GET "Your record has been updated"

Posted on 2004-04-26
1
Medium Priority
?
153 Views
Last Modified: 2010-04-25
I have created a page that has a lot of diffent function on it to drill down thought diffent recordset and then ends up at update form. when this update is completed i want somewhere on the page a message to apper that says your reord has been updated.

how easy is this to do?

Will
0
Comment
Question by:willa666
[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
1 Comment
 
LVL 8

Accepted Solution

by:
alexhogan earned 1000 total points
ID: 10925344
For the most part is just a matter of creating the page that says what you want it to say.

You should however capture the value of the successful update.  This is usually a boolean value.
(1 for success and 0 for unsuccessful)  
In reality the value will start at 0 so all you have to do is check for a value that's not 0.

Depending on the language that you're using it's pretty straight forward.  It will be the return value of the query.

i.e. - (psuedo code)
query = update table
            set field = value
            where field = original value;

result = mydatabase_query(query);

if(result != 0){
    redirection code here to my_successful.html
}
else{
   redirection code here to my_unsuccessful.html
}

You could even have the same page for both success and failure of the update by using a conditional branch on the page and passing a url parameter to it.

NOTE: I like to use a switch statement for these kinds of conditions because it allows me to add to it with little effort.  If I used an 'if' statement and had to add to it, it could become unruly pretty quick.  Of course you might want to keep these kinds of conditions seperate.  It's all up to you.

switch(urlparam){
    case 1:
        successful update text here
    break;

    default:
        unsuccellful update text here
    break;
}

Then you would call your page like this;

if(result != 0){
    redirection code here to my_resultpage.html?urlparam=1
}
else{
   redirection code here to my_resultpage.html?urlparam=0
                     --  or even --
   redirection code here to my_resultpage.html
(since you set up the default condition as being unsuccessful)
}
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 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