Solved

HOW TO GET "Your record has been updated"

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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 …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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