MySQL 1046 error resolution instance

Source: Internet
Author: User

MySQL 1046 Error Resolution:

? Php
Require_once './include/common.inc.php ';

$maxpostnum = 200; Set the minimum number of posts

if (! $discuz _user | |! $discuz _PW) {
ShowMessage (' Sorry, you haven't logged in yet, you can't do this. ');
}

if (! $adminid) {
$query = $db->query ("Select Postnum,credit from bbs.cdb_members WHERE username = ' $discuz _user '");
$blogAccess = $db->fetch_array ($query);
if ($blogaccess [' Postnum '] < $maxpostnum) {
ShowMessage (' Sorry, your current level is not open RSS aggregation service ');
}
}

$query = $db->query ("Select username from uploader.uploader_users WHERE username = ' $discuz _user '");
$bloguser = $db->fetch_array ($query);
if ($action = = "") {
Include template (' Rss_reg ');
}

if ($action = = "Kaihu") {
if (! $bloguser [' user ']) {
$query = $db->query ("Select Uid,username,password,email,regdate from bbs.cdb_members WHERE username = ' $discuz _user '" ");
$bloginfo = $db->fetch_array ($query);
$db->query ("INSERT into uploader.uploader_users (username, password, email, reg_date)
VALUES (' $bloginfo [username] ', ' $bloginfo [password] ', ' $bloginfo [email] ', ' $bloginfo [regdate] ');
$db->query ("UPDATE bbs.cdb_members SET RSS = 1 WHERE username = ' $discuz _user '");
ShowMessage (' account opened, you can enter the management ', ' http://rss.twbbs.biz ');
}else {
$db->query ("UPDATE bbs.cdb_members SET rss =1 WHERE username = ' $discuz _user '");
ShowMessage (' Your account has been opened ', ' http://rss.twbbs.biz ');
}
}
?>

Sql:insert into uploader.uploader_users (username, password, email, reg_date)

VALUES (' sa ', ' 40c76244e235aa23e73acb4a457f9748 ', ' sa@gmail.com ', ' 1132236495 ')

Error: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

Errno.: 1064

Must the Uploader_users ID also be inserted in the ID of the Bbs.cdb_member noodle?

Workaround:

Put

PHP Code:

$db->query ("INSERT into uploader.uploader_users (username, password, email, reg_date)

VALUES (' $bloginfo [username] ', ' $bloginfo [password] ', ' $bloginfo [Emal] ', ' $bloginfo [regdate] ');

Into:

PHP Code:

$db->query ("INSERT into uploader.uploader_users (username, password, email, reg_date)

VALUES (' $bloginfo [username] ', ' $bloginfo [password] ', ' $bloginfo [Emal] ', ' $bloginfo [RegDate] ')];

Reason: A closing parenthesis was missing.

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.