im having some problem with this code:
if (count($_POST)) {
$username = mysql_real_escape_string($_POST['username']);
$passwd = mysql_real_escape_string($_POST['passwd']);
mysql_query("INSERT INTO users (username, password)
VALUES ($username, $passwd)");
}
<form method="post">
<p><input type="text" name="username" /></p>
<p><input type="password" name="passwd" /></p>
<p><input type="submit" value="Register me!" /></p>
</form>
i am connected to db
the users column ID is auto_increment
I get this when adding or die mysql_error in sql statement: 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 2