How to show alert box after successful data insertion in mysql?

  PHP

Email

Please go to this coding will be understanding

When you are writing coding please use insert code using the javascript function you need to update this code.

 $query = “INSERT INTO tbl_call_isert(name, mail, mobile) VALUES(‘$name’, ‘$mail’, ‘$mobile’)”;
                    $inserted_row = $this->db->insert($query);
                    if ($inserted_row) {
                        echo ‘<script language=”javascript”>’;
                        echo ‘alert(“Successfully Registered”); location.href=”thanskpage.php”‘;
                        echo ‘</script>’;
                    } else {
                        $msg = “<span class=’error’>Customer Data Not Inserted.</span>”;
                        return $msg;
                    }

 

 

 

 

 

 

Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of