- <?php
- include_once("config.php");
- if(isset($_POST['Submit']))
- {
- $name=$_POST['name'];
- $email=$_POST['email'];
- $result=mysql_query("INSERT INTO store(name,email) VALUES('$name','$email')");
- //header("Location: view.php");
- echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">';
- if($result==true)
- {
- ?>
- <script type="text/javascript">
- alert('Data success fully stored');
- </script>
- <?php
- }
- }
- ?>
In this code is how to insert data in to mysql database in php mysql.
