mysql 1046错误解决实例
2009-02-11 11:16:48 来源:WEB开发网MySQL 1046错误解决:
<?PHP
require_once './include/common.inc.php';
$maxpostnum = 200; //设定最小帖子数量
if(!$discuz_user || !$discuz_pw) {
showmessage('对不起,您还没有登录,无法进行此操作。');
}
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 ('对不起,您目前的等级无开通RSS聚合服务');
}
}
$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('帐户开通完毕,您可以进入管理了','http://rss.twbbs.biz');
}else {
$db->query("UPDATE bbs.cdb_members SET rss =1 WHERE username = '$discuz_user'");
showmessage('你的帐户已经开通','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
必須還得 把 uploader_users id 也按 bbs.cdb_member 裏麵的ID插入嗎?
解决方法:
把
PHP代码:
$db->query("INSERT INTO uploader.uploader_users (username, password, email, reg_date)
VALUES ('$bloginfo[username]' ,'$bloginfo[password]' ,'$bloginfo[emal]' ,'$bloginfo[regdate]'");
换成:
PHP代码:
$db->query("INSERT INTO uploader.uploader_users (username, password, email, reg_date)
VALUES ('$bloginfo[username]' ,'$bloginfo[password]' ,'$bloginfo[emal]' ,'$bloginfo[regdate]')");
原因:少了一个右括号。
- ››MySQL定时执行存储过程
- ››mysql数据导入sqlserver数据库方法
- ››解决flash 中无法导出swf文件的方法
- ››解决"ios模拟器未能安装此应用程序"办法...
- ››解决jquery easyui easyloader加载外部js文件失败...
- ››解决无法使用Android SDK Manager下载SDK开发包的...
- ››解决网页内容无法复制
- ››解决Android手机在开发调试时logcat不显示输出信息...
- ››解决Windows 8操作系统假死的方法
- ››解决ubuntu 不识别 android 设备 方法
- ››解决ubuntu server sudo出现sudo:must be setuid ...
- ››解决数据库 Table 'content_tags' is mar...
更多精彩
赞助商链接