I'm trying to create a website page with different inputs. A name and an email (and a submit button, if you count that). My problem is that instead of returning the data that I input in my html form to phpmyadmin, it sends an "empty result set". I'm not new to html, but I am new to php, so I think that is where my problem resides. Here is my code...
<html>
<body>
<form action="#" method="POST">
<table width="20%" border="0" cellspacing="2" cellpadding="1">
<tr>
<td>Name:</td>
<td colspan="2"><input type="text" name="name"></td>
</tr>
<tr>
<td>Email:</td>
<td colspan="2"><input type="text" name="email"></td>
</tr>
<tr>
<td> </td>
<td colspan="2"><input type="submit" name="submit" value="Submit></td>
</tr>
</table>
</form>
</body>
</html>
<?php
$con=mysqli_connect("localhost","root","");
mysqli_select_db($con,"mpet");
if(isset($_POST['submit']))
{
$name=$_POST['name'];
mysqli_query($con,"insert into user(name) values('$name')");
$email=$_POST['email'];
mysqli_query($con,"insert into user(email) values('$email')");
}
?>
Thanks for any help you can give me.