I'm Trying To Write a login/register system, i got the login down but i need help with registration
Could not enter data: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
My Written code
<?php
$dbhost = '';
$dbuser = '';
$dbpass = '';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
$sql = 'INSERT INTO members '.
'(id,username,password) '.
'VALUES ( 2, test, test';
mysql_select_db('');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
echo "Registered
";
mysql_close($conn);
?>
Also i need a checker to see if the username is taken and assign a id, going up from whats in my DB, my db is a table called members, inside the table is ID(Ascending number(currently at 1)) Username, password.
I don't need the password encrypted, I have something in place for that elsewhere.