Solved

HOW TO GET "Your record has been updated"

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dreamweaver, can't connect to MYSQL Local Database on Mac 18 3,136
Adobe Web Premium CS3 5 374
CSS HTML Text Alignment 13 419
drop down button disappears 12 99
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

26 Experts available now in Live!

Get 1:1 Help Now