Database instance: how to solve the mysql 1046 Error

Source: Internet
Author: User

Mysql 1046 error solution:

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

$ Maxpostnum = 200; // sets the minimum number of posts.


If (! $ Discuz_user |! $ Discuz_pw ){
Showmessage ('Sorry, you have not logged on. You cannot perform this operation. ');
}

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, you have not activated the 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 ('after the account is activated, you can go to manage ', 'HTTP: // rss. twbbs. biz ');
} Else {
$ Db-> query ("UPDATE bbs. cdb_members SET rss = 1 WHERE username = '$ discuz_user '");
Showmessage ('your account has been activated ', 'HTTP: // rss. twbbs. biz ');
}
}
?>

SQL: INSERT INTO uploader. uploader_users (username, password, email, reg_date)
VALUES ('sa ', '40c76244e235aa23e73acb4a457f9748', 'sa @ gmail.com ', '123'
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

Do I have to insert the uploader_users id according to the ID of bbs. cdb_member member failed?

Solution:
Set

PHP code:

$ Db-> query ("insert into uploader. uploader_users (username, password, email, reg_date)
VALUES ('$ bloginfo [username]', '$ bloginfo [password]', '$ bloginfo [emal]', '$ bloginfo [regdate]' ");

Replace:

PHP code:

$ Db-> query ("insert into uploader. uploader_users (username, password, email, reg_date)
VALUES ('$ bloginfo [username]', '$ bloginfo [password]', '$ bloginfo [emal]', '$ bloginfo [regdate]') ");

Cause: an angle bracket is missing.

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.