Register page appears column count doesn ' t match value count at row 1

Source: Internet
Author: User
Session_Start ();
Define (' In_tg ', true);
Require ' include/global.php ';
Require DirName (__file__). ' /include/header.php ';
Require ' include/register.inc.php ';

if (@$_get[' action ']== ' 2 ') {

Check_code ($_post[' yzm '],$_session[' Code ');
$_clean=array ();
$_clean[' uniqid ']=check_uniqid ($_post[' uniqid '), $_session[' uniqid ']);
$_clean[' active ']=active_uniqid ();
$_clean[' username ']=check_username ($_post[' username '],2,40);
$_clean[' Password ']=check_password ($_post[' password '), $_post[' Notpassword '],6);
$_clean[' Passt ']=check_question ($_post[' passt '], 4, 20);
$_clean[' PASSD ']=check_answer ($_post[' passt '],$_post[' passd '],2,20 ');
$_clean[' Sex ']=check_sex ($_post[' sex ');
$_clean[' email ']=check_mail ($_post[' email '],6,40);
$_clean[' $_qq ']=check_qq ($_post[' QQ ');
$_clean[' $_url ']=check_url ($_post[' url '],40);

@mysql_query ("INSERT into Project.test1 (
TG_ID,
Tg_uniqid,
Tg_active,
Tg_usename,
Tg_password,
TG_PASST,
TG_PASSD,
Tg_email,
TG_QQ,
Tg_url,
Tg_sex,
Tg_reg_time,
Tg_last_time,
Tg_last_ip
)
Values
' {$_clean[' uniqid '} ',
' {$_clean[' active ']} ',
' {$_clean[' username '} ',
' {$_clean[' password '} ',
' {$_clean[' passt '} ',
' {$_clean[' passd '} ',
' {$_clean[' email ']} ',
' {$_clean[' qq ']} ',
' {$_clean[' url ']} ',
' {$_clean[' sex ']} '
' Now () ',
' Now () ',
' {$_server[' remote_addr "]} '
) or Die (Mysql_error ());
Mysql_close ();
Location (' Congratulations, registration successful ', ' 1.php ');
}else{$_session[' uniqid ']=$_uniqid=sha1 (Uniqid (rand (), True));}

?>




<title>Multi-user Message system--Registration</title>

Define (' script ', ' register ');
Require DirName (__file__). ' /include/tittle.php ';
?>




Require DirName (__file__). ' /include/header.php ';
?>

Member Registration






Require DirName (__file__). ' /include/footer.php ';
?>
database field Name
tg_id Mediumint (8) UNSIGNED No
Tg_uniqid char (UTF8_GENERAL_CI) No No
Tg_active char (UTF8_GENERAL_CI) No No
Tg_usename varchar (UTF8_GENERAL_CI) No
Tg_password char (UTF8_GENERAL_CI) No No
TG_PASST varchar (UTF8_GENERAL_CI) No
TG_PASSD char (UTF8_GENERAL_CI) No No
Tg_sex varchar (1) utf8_general_ci No
Tg_email varchar (UTF8_GENERAL_CI) is NULL
TG_QQ tinyint (10) is NULL
Tg_url varchar (UTF8_GENERAL_CI) is NULL
Tg_reg_time datetime No No
Tg_last_time datetime No No
tg_last_id varchar (CP1251_GENERAL_CI) No
Select All/Uncheck All selected items:


Reply to discussion (solution)

The field list for the Insert directive is 14, and the value list is only 13
The corresponding value of the missing tg_id should be
If the tg_id value self-increment field, you can delete

In addition, the now () function is not enclosed in quotation marks, otherwise it becomes a string.

The now () function does not enclose an error in quotation marks, even if the corresponding value of the ID is added, column count doesn ' t match value count at row 1

Column count doesn ' t match value count
Number of columns does not match

If you insist on being wrong, I won't say anything.

Will it be a database field problem

Value in values doesn't match the number of previous columns

does not correspond to the database how to do insert processing? As you originally ate a bowl of rice, now give you two bowls you must not eat, that the duly error AH.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.