MySQL Forums
Forum List  »  PHP

Column count doesn't match value count at row 1
Posted by: Alex Brazier
Date: January 27, 2011 06:01PM

i keep getting this error and i cant work out what i have done wrong,
here is what i have done
any help would be appreciated
thanks

<?php

mysql_connect('localhost', 'username', 'password')or die (mysql_error()) ;
mysql_select_db("test2")or die (mysql_error());



if ($_POST['submit']) {

$username = $_POST['username'];
$email = $_POST['email'];
$website = $_POST['website'];
$password1 = $_POST['password1'];



mysql_query("INSERT INTO users (id, username, password, email, website)
VALUES ('', '{$username}', '{$password1}', '{$email}', '{$website}', NOW());") or die (mysql_error());


}
?>




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">;
<html xmlns="http://www.w3.org/1999/xhtml">;
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>






<form action="Registerattempt3.php" method="post">

Username: <br />
<input type="text" name="username" value="" /><br /><br />

Email: <br />
<input type="text" name="email" value="" /><br /><br />

Website: <br />
<input type="text" name="website" value="" /><br /><br />

Password: <br />
<input type="password" name="password1" value="" /><br /><br />

Retype Password: <br />
<input type="password" name="password" value="" /><br /><br />

<input type="submit" name="submit" value="Register!" />

</form>




</body>
</html>

Options: ReplyQuote


Subject
Written By
Posted
Column count doesn't match value count at row 1
January 27, 2011 06:01PM


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.