Solved

HOW TO GET "Your record has been updated"

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now