destoon复制模块是出现的mysql报错,求大神解决
MySQL Query:SELECT * FROM [pre]vipcenter_25 WHERE status=3 ORDER BY LIMIT 0,20
MySQL 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 'LIMIT 0,20' at line 1 MySQL Errno:0
Message:MySQL Query Error
我想在公司主页上添加一个“成功案例”的新模块,复制的“品牌展示”的模块,把代码中的brand批量替换成success,其他都没问题就是在后台模块编辑时候出现这个报错
回复讨论(解决方案)
SELECT * FROM [pre]vipcenter_25 WHERE status=3 ORDER BY LIMIT 0,20
检查下sql,是否可以执行。
ORDER BY XX LIMIT 0,20
不能执行,,
SELECT * FROM [pre]vipcenter_25 WHERE status=3 ORDER BY LIMIT 0,20
多了套红的部分,如何你能运行?
SELECT * FROM [pre]vipcenter_25 也报错
SQL] SELECT * FROM [pre]vipcenter_25
[Err] 1064 - 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 '[pre]vipcenter_25' at line 1
SQL] SELECT * FROM [pre]vipcenter_25
[Err] 1064 - 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 '[pre]vipcenter_25' at line 1
确定你表的名称书写正确,还有order by xx xx必须为表的字段属性,你上面未加上。
我试了,加上了也不行啊
SQL] SELECT * FROM [pre]vipcenter_25
[Err] 1064 - 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 '[pre]vipcenter_25' at line 1
确定你表的名称书写正确,还有order by xx xx必须为表的字段属性,你上面未加上。
are you sure?
其实我也不太懂,我是个新手,但是我是完全复制的原有的模块的代码,数据库也新建了表,不知道是哪里出了问题
其实我也不太懂,我是个新手,但是我是完全复制的原有的模块的代码,数据库也新建了表,不知道是哪里出了问题
确定你表的名称书写正确,还有order by xx xx必须为表的字段属性,你上面未加上。
1.select * from tablename?
2.select * from tablename order by id?
function get_list($condition = 'status=3', $order = 'edittime DESC', $cache = '') {
global $MOD, $pages, $page, $pagesize, $offset, $items, $sum;
if($page > 1 && $sum) {
$items = $sum;
} else {
$r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache);
$items = $r['num'];
}
$pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize);
$lists = $catids = $CATS = array();
$result = $this->db->query(" SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache);
while($r = $this->db->fetch_array($result)) {
$r['adddate'] = timetodate($r['addtime'], 5);
$r['editdate'] = timetodate($r['edittime'], 5);
$r['todate'] = timetodate($r['totime'], 3);
$r['alt'] = $r['title'];
$r['title'] = set_style($r['title'], $r['style']);
$r['linkurl'] = $MOD['linkurl'].$r['linkurl'];
$catids[$r['catid']] = $r['catid'];
$lists[] = $r;
}
SELECT * FROM destoon_vipcenter_25 WHERE status=3 ORDER BY edittime LIMIT 0,20 可以查询
输出看看:
die("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize");
检查{$this->table},$condition,$order , $offset, $pagesize,对应是否有值
SELECT * FROM [pre]vipcenter_25 也报错
表名字怎么会出现这个?
输出看看:
die("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize");
检查{$this->table},$condition,$order , $offset, $pagesize,对应是否有值
什么都没输出,没有值
SELECT * FROM [pre]vipcenter_25 也报错
表名字怎么会出现这个?
这个我也不清楚,以前没学过php
源代码:
echo "SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize";
die();
再试试
defined('IN_DESTOON') or exit('Access Denied');
class vipcenter {
var $moduleid;
var $itemid;
var $db;
var $table;
var $table_data;
var $split;
var $fields;
var $errmsg = errmsg;
var $pre;
function vipcenter($moduleid) {
global $db, $table, $table_data, $MOD;
$this->moduleid = $moduleid;
$this->table = $table;
$this->table_data = $table_data;
$this->split = $MOD['split'];
$this->db = &$db;
$this->pre = $this->db->pre;
$this->fields = array('catid','level','title','style','fee','introduce','areaid','thumb','homepage','status','hits','username','addtime','adddate','editor','edittime','editdate','ip','template', 'linkurl','filepath','note','company','truename','telephone','mobile','address','email','msn','qq','ali','skype');
}
function pass($post) {
global $DT_TIME, $MOD;
if(!is_array($post)) return false;
if(!$post['catid']) return $this->_(lang('message->pass_catid'));
if(strlen($post['title']) _(lang('message->pass_title'));
if(!$post['thumb']) return $this->_(lang('message->pass_logo'));
return true;
}
function set($post) {
global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
$post['editor'] = $_username;
$post['addtime'] = (isset($post['addtime']) && $post['addtime']) ? strtotime($post['addtime']) : $DT_TIME;
$post['adddate'] = timetodate($post['addtime'], 3);
$post['edittime'] = $DT_TIME;
$post['editdate'] = timetodate($post['edittime'], 3);
$post['fee'] = dround($post['fee']);
$post['homepage'] = fix_link(trim($post['homepage']));
$post['video'] = fix_link(trim($post['video']));
$post['video_width'] = intval($post['video_width']);
$post['video_height'] = intval($post['video_height']);
$post['title'] = trim($post['title']);
$post['content'] = stripslashes($post['content']);
$post['content'] = save_local($post['content']);
if($MOD['clear_link']) $post['content'] = clear_link($post['content']);
if($MOD['save_remotepic']) $post['content'] = save_remote($post['content']);
if($MOD['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
if($this->itemid) {
$new = $post['content'];
if($post['thumb']) $new .= '';
$r = $this->get_one();
$old = $r['content'];
if($r['thumb']) $old .= '';
delete_diff($new, $old);
} else {
$post['ip'] = $DT_IP;
}
if(!defined('DT_ADMIN')) {
$content = $post['content'];
unset($post['content']);
$post = dhtmlspecialchars($post);
$post['content'] = dsafe($content);
}
$post['content'] = addslashes($post['content']);
return array_map("trim", $post);
}
function get_one() {
$content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data);
return $this->db->get_one("SELECT * FROM {$this->table} a,{$content_table} c WHERE a.itemid=c.itemid and a.itemid=$this->itemid");
}
function get_list($condition = 'status=3', $order = 'edittime DESC', $cache = '') {
global $MOD, $pages, $page, $pagesize, $offset, $items, $sum;
if($page > 1 && $sum) {
$items = $sum;
} else {
$r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache);
$items = $r['num'];
}
$pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize);
$lists = $catids = $CATS = array();
$result = $this->db->query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache);
while($r = $this->db->fetch_array($result)) {
$r['adddate'] = timetodate($r['addtime'], 5);
$r['editdate'] = timetodate($r['edittime'], 5);
$r['todate'] = timetodate($r['totime'], 3);
$r['alt'] = $r['title'];
$r['title'] = set_style($r['title'], $r['style']);
$r['linkurl'] = $MOD['linkurl'].$r['linkurl'];
$catids[$r['catid']] = $r['catid'];
$lists[] = $r;
}
if($catids) {
$result = $this->db->query("SELECT catid,catname,linkurl FROM {$this->db->pre}category WHERE catid IN (".implode(',', $catids).")");
while($r = $this->db->fetch_array($result)) {
$CATS[$r['catid']] = $r;
}
if($CATS) {
foreach($lists as $k=>$v) {
$lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : '';
$lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : '';
}
}
}
return $lists;
}
function add($post) {
global $MOD;
$post = $this->set($post);
$sqlk = $sqlv = '';
foreach($post as $k=>$v) {
if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; }
}
$sqlk = substr($sqlk, 1);
$sqlv = substr($sqlv, 1);
$this->db->query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)");
$this->itemid = $this->db->insert_id();
$content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data);
$this->db->query("INSERT INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')");
$this->update($this->itemid);
if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) {
credit_add($post['username'], $MOD['credit_add']);
credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid);
}
clear_upload($post['content'].$post['thumb'], $this->itemid);
return $this->itemid;
}
function edit($post) {
$this->delete($this->itemid, false);
$post = $this->set($post);
$sql = '';
foreach($post as $k=>$v) {
if(in_array($k, $this->fields)) $sql .= ",$k='$v'";
}
$sql = substr($sql, 1);
$this->db->query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid");
$content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data);
$this->db->query("UPDATE {$content_table} SET content='$post[content]' WHERE itemid=$this->itemid");
$this->update($this->itemid);
clear_upload($post['content'].$post['thumb'], $this->itemid);
if($post['status'] > 2) $this->tohtml($this->itemid, $post['catid']);
return true;
}
function tohtml($itemid = 0, $catid = 0) {
global $module, $MOD;
if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid");
}
function update($itemid) {
$item = $this->db->get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid");
$update = '';
$keyword = $item['title'].','.$item['company'].','.strip_tags(cat_pos(get_cat($item['catid']), ',')).strip_tags(area_pos($item['areaid'], ','));
if($keyword != $item['keyword']) {
$keyword = str_replace("//", '', addslashes($keyword));
$update .= ",keyword='$keyword'";
}
$item['itemid'] = $itemid;
$linkurl = itemurl($item);
if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'";
$member = $item['username'] ? userinfo($item['username']) : array();
if($member) {
foreach(array('groupid','vip','validated','company','areaid','truename','telephone','mobile','address','qq','msn','ali','skype') as $v) {
if($item[$v] != $member[$v]) $update .= ",$v='".addslashes($member[$v])."'";
}
if($item['email'] != $member['mail']) $update .= ",email='".addslashes($member['mail'])."'";
}
if($update) $this->db->query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid");
}
function recycle($itemid) {
if(is_array($itemid)) {
foreach($itemid as $v) { $this->recycle($v); }
} else {
$this->db->query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid");
$this->delete($itemid, false);
return true;
}
}
function restore($itemid) {
global $module, $MOD;
if(is_array($itemid)) {
foreach($itemid as $v) { $this->restore($v); }
} else {
$this->db->query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid");
if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid");
return true;
}
}
function delete($itemid, $all = true) {
global $MOD;
if(is_array($itemid)) {
foreach($itemid as $v) {
$this->delete($v, $all);
}
} else {
$this->itemid = $itemid;
$r = $this->get_one();
if($MOD['show_html']) {
$_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl'];
if(is_file($_file)) unlink($_file);
}
if($all) {
$userid = get_user($r['username']);
if($r['thumb']) delete_upload($r['thumb'], $userid);
if($r['content']) delete_local($r['content'], $userid);
$this->db->query("DELETE FROM {$this->table} WHERE itemid=$itemid");
$content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data);
$this->db->query("DELETE FROM {$content_table} WHERE itemid=$itemid");
if($MOD['cat_property']) $this->db->query("DELETE FROM {$this->db->pre}category_value WHERE moduleid=$this->moduleid AND itemid=$itemid");
if($r['username'] && $MOD['credit_del']) {
credit_add($r['username'], -$MOD['credit_del']);
credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid);
}
}
}
}
function check($itemid) {
global $_username, $DT_TIME, $MOD;
if(is_array($itemid)) {
foreach($itemid as $v) { $this->check($v); }
} else {
$this->itemid = $itemid;
$item = $this->get_one();
if($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) {
credit_add($item['username'], $MOD['credit_add']);
credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid);
}
$editdate = timetodate($DT_TIME, 3);
$this->db->query("UPDATE {$this->table} SET status=3,hits=hits+1,editor='$_username',edittime=$DT_TIME,editdate='$editdate' WHERE itemid=$itemid");
$this->tohtml($itemid);
return true;
}
}
function reject($itemid) {
global $_username, $DT_TIME;
if(is_array($itemid)) {
foreach($itemid as $v) { $this->reject($v); }
} else {
$this->db->query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid");
return true;
}
}
function clear($condition = 'status=0') {
$result = $this->db->query("SELECT itemid FROM {$this->table} WHERE $condition ");
while($r = $this->db->fetch_array($result)) {
$this->delete($r['itemid']);
}
}
function level($itemid, $level) {
$itemids = is_array($itemid) ? implode(',', $itemid) : $itemid;
$this->db->query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)");
}
function refresh($itemid) {
global $DT_TIME;
$editdate = timetodate($DT_TIME, 3);
$itemids = is_array($itemid) ? implode(',', $itemid) : $itemid;
$this->db->query("UPDATE {$this->table} SET edittime='$DT_TIME',editdate='$editdate' WHERE itemid IN ($itemids)");
}
function _($e) {
$this->errmsg = $e;
return false;
}
}
?>
输出:SELECT * FROM destoon_vipcenter_25 WHERE status=3 ORDER BY LIMIT 0,20
echo "SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize";
die();
再试试
你还是针对这个问题,贴出输出结果吧,不然你问的问题,没办法解答了。
问题算是解决了,function get_list($condition = 'status=3', $order = 'edittime DESC', $cache = '') {
global $MOD, $pages, $page, $pagesize, $offset, $items, $sum;
if($page > 1 && $sum) {
$items = $sum;
} else {
$r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache);
$items = $r['num'];
}
$pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize);
$lists = $catids = $CATS = array();
$result = $this->db->query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache);
是获得不了$order的值,直接用edittime DESC代替$order,运行没问题。但是现在不明白是为什么获得不了$order的值
echo "SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize";
die();
再试试
你还是针对这个问题,贴出输出结果吧,不然你问的问题,没办法解答了。
还是非常感谢你!
这个问题我告诉你原因吧,你复制了模块之后 没对模块进行设置 点击菜单最下面 模块设置 设置一下模块就好了。 这绝对是正确答案 你不要着急去改代码 代码没有问题的 。

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

Win11系统无法安装中文语言包的解决方法随着Windows11系统的推出,许多用户开始升级他们的操作系统以体验新的功能和界面。然而,一些用户在升级后发现他们无法安装中文语言包,这给他们的使用体验带来了困扰。在本文中,我们将探讨Win11系统无法安装中文语言包的原因,并提供一些解决方法,帮助用户解决这一问题。原因分析首先,让我们来分析一下Win11系统无法

随着智能手机技术的不断发展,手机在我们日常生活中扮演着越来越重要的角色。而作为一款专注于游戏性能的旗舰手机,黑鲨手机备受玩家青睐。然而,有时候我们也会面临到黑鲨手机开不了机的情况,这时候我们就需要采取一些措施来解决这一问题。接下来,就让我们来分享五招教你解决黑鲨手机开不了机的问题:第一招:检查电池电量首先,确保你的黑鲨手机有足够的电量。可能是因为手机电量耗尽

随着社交媒体的不断发展,小红书已经成为越来越多年轻人分享生活、发现美好事物的平台。许多用户在发布图片时遇到了自动保存的问题,这让他们感到十分困扰。那么,如何解决这个问题呢?一、小红书发布自动保存图片怎么解决?1.清除缓存首先,我们可以尝试清除小红书的缓存数据。步骤如下:(1)打开小红书,点击右下角的“我的”按钮;(2)在个人中心页面,找到“设置”并点击;(3)向下滚动,找到“清除缓存”选项,点击确认。清除缓存后,重新进入小红书,尝试发布图片看是否解决了自动保存的问题。2.更新小红书版本确保你的小

大家都知道,如果电脑无法加载驱动程序,该设备可能就无法正常工作或与计算机进行正确的交互。那在电脑上弹出无法在此设备上加载驱动程序的提示框,我们要如何解决呢?下面小编就教大家两招轻松解决问题。 无法在此设备上加载驱动程序解决方法 1、开始菜单搜索“内核隔离”。 2、将内存完整性关闭,上方提示“内存完整性已关闭。你的设备可能易受攻击。”点击后方忽略即可,不会对使用有影响。 3.重启机器之后即可解决问题。

我们用户们在使用这款平台的时候应该都能够了解到上面对于一些功能的多样性,我们知道一些歌曲的歌词都写的非常的不错。有时候甚至都会多听几遍,觉得其中的含义都是非常深刻的,所以我们想要去了解其中的胜意,就想要直接的复制下来当文案来使用,不过对于要使用的话,还是要学会如何去复制歌词才可以,这些操作方面我相信大家们应该都并不模式,但是在手机上面操作确实是有点难度,所以为了能够让大家们更好的了解的话,今日小编就来为你们好好的讲解上面的一些操作体验,如果你们也喜欢的话,就和小编一起来看看吧,不要错过了。

华为浏览器已停止访问该网页怎么解决?在使用华为手机浏览器访问某些网站时,可能会出现禁止访问的提示,使用户无法正常浏览相关内容。这对用户而言非常不便。那么,当我们遇到华为手机浏览器网站禁止访问的情况时,该怎么办呢?下面小编将为您提供华为浏览器网站禁止访问解决方法,希望对您有所帮助。华为浏览器网站禁止访问解决方法1、打开华为手机浏览器后,点击下方的三点图标,然后点击设置。2、进入设置后,点击【安全与隐私】3、将【安全浏览】右侧的开关关闭,即可解除网站访问限制。以上便是华为浏览器网站禁止访问解决方法的

标题:分析Oracle错误3114:原因及解决方法在使用Oracle数据库时,常常会遇到各种错误代码,其中错误3114是比较常见的一个。该错误一般涉及到数据库链接的问题,可能导致访问数据库时出现异常情况。本文将对Oracle错误3114进行解读,探讨其引起的原因,并给出解决该错误的具体方法以及相关的代码示例。1.错误3114的定义Oracle错误3114通

http请求报错:SocketError的解决方法在进行网络请求时,我们经常会遇到各种各样的错误,其中一个常见的问题就是SocketError。当我们的应用程序无法与服务器建立连接时,就会抛出这个错误。在本文中,我们将讨论SocketError的一些常见原因和解决方法。首先,我们需要了解Socket是什么。Socket是一种通信协议,它允许应用程序通过
