MySQL Forums
Forum List  »  PHP

PHP SQL Registration Help
Posted by: Jason Ross
Date: July 25, 2005 05:59PM

I'm trying to get it so that users have to register to login to my website. But I always get the error: Column count doesn't match value count at row 1

Here is the code:

register.html
-------------
<html>
<body>
<form action="add_user.php" method="post">
<p>Pick a Username:<br>
<input type="text" name="username" size=25>
<input type="submit" name="submit" value="Register"></p>
</form>
</body>
</html>

add_user.php
--------------
<?php
$conn = mysql_connect("localhost", "user", "pass");
mysql_select_db ("auth",$conn);
$sql = "INSERT INTO auth values ('', '$_POST[username]')";
$result = mysql_query($sql, $conn) or die(mysql_error());
echo $result;
?>

My SQL Database name is: auth, and the table name is auth


Thanks

Options: ReplyQuote


Subject
Written By
Posted
PHP SQL Registration Help
July 25, 2005 05:59PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.