Solved

HOW TO GET "Your record has been updated"

Posted on 2004-04-26
1
150 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 250 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

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

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

752 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