0

i am developing database driven web application. I want to show a pop up when MySql query runs successfully. for example

when my database is successfully updated

$result = mysql_query("DELETE FROM students WHERE Roll_No = '$rollno'") or die("SELECT Error: ".mysql_error());
$student_info = mysql_fetch_row($result);


if($result) 
{
    echo "<script> alert('Deleted successfully!')<script>";
        exit;

}
else
{    
echo "<script> alert('Temporary problem, try again!');</script>";
}
?>

it is working fine for me and shows simple JavaScript alert in browser. i want a fancy pop up in the middle of the browser fading the background and auto close after showing the alert say after 10 second. I know it can be done by JavaScript but i don't have enough knowledge of JavaScript, Kindly guide me in the direction so that i can do it or if someone explains me with any example will be great help for me.

5

1 Answer 1

1

You can use jQuery for this purpose and design it to your liking.

$(function() {
    $( "#dialog-message" ).dialog({
      modal: true,
      autoOpen: false,
      buttons: {
        Ok: function() {
          $( this ).dialog( "close" );
        });   

Check this page out

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.