i am learning php and i am trying to insert data into a database from a form using php. here is the php
<?php
include "connecttodb.php";
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['pass'];
$query = "INSERT INTO ******* SET username='$name', password='$password', email='$email'";
mysql_query($query)
or die('There was an error in your registration');
echo'Registration Complete!';
mysql_close();
?>
and i keep getting the error 'There was an error in your registration'.
here is the html for it:
<form action='register.php' method='post'>
Username:<input type='text' name='name'><br/>
Email:<input type='text' name='email'><br/>
Password:<input type='text' name='pass'><br/>
<input type='submit' value='submit'>
</form>
if anybody could help i would greatly appreciate it