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、開始功能表搜尋「核心隔離」。 2、將記憶體完整性關閉,上方提示「記憶體完整性已關閉。你的裝置可能易受攻擊。」點擊後方忽略即可,不會對使用有影響。 3.重啟機器之後即可解決問題。

隨著社群媒體的不斷發展,小紅書已經成為越來越多年輕人分享生活、發現美好事物的平台。許多用戶在發布圖片時遇到了自動儲存的問題,這讓他們感到十分困擾。那麼,如何解決這個問題呢?一、小紅書發布自動儲存圖片怎麼解決? 1.清除快取首先,我們可以嘗試清除小紅書的快取資料。步驟如下:(1)開啟小紅書,點選右下角的「我的」按鈕;(2)在個人中心頁面,找到「設定」並點選;(3)向下捲動,找到「清除快取」選項,點擊確認。清除快取後,重新進入小紅書,嘗試發布圖片看是否解決了自動儲存的問題。 2.更新小紅書版本確保你的小

我們用戶們在使用這款平台的時候應該都能夠了解到上面對於一些功能的多樣性,我們知道一些歌曲的歌詞都寫的非常的不錯。有時候甚至都會多聽幾遍,覺得其中的含義都是非常深刻的,所以我們想要去了解其中的勝意,就想要直接的複製下來當文案來使用,不過對於要使用的話,還是要學會如何去複製歌詞才可以,這些操作方面我相信大家們應該都並不模式,但是在手機上面操作確實是有點難度,所以為了能夠讓大家們更好的了解的話,今日小編就來為你們好好的講解上面的一些操作體驗,如果你們也喜歡的話,就和小編一起來看看吧,不要錯過了。

華為瀏覽器已停止造訪該網頁怎麼解決?使用華為手機瀏覽器造訪某些網站時,可能會出現禁止造訪的提示,使用戶無法正常瀏覽相關內容。這對用戶而言非常不便。那麼,當我們遇到華為手機瀏覽器網站禁止造訪的情況時,該怎麼辦呢?以下小編將為您提供華為瀏覽器網站禁止存取解決方法,希望對您有所幫助。華為瀏覽器網站禁止訪問解決方法1、打開華為手機瀏覽器後,點擊下方的三點圖標,然後點擊設定。 2.進入設定後,點選【安全與隱私】3、將【安全瀏覽】右側的開關關閉,即可解除網站存取限制。以上便是華為瀏覽器網站禁止存取解決方法的

標題:分析Oracle錯誤3114:原因及解決方法在使用Oracle資料庫時,常常會遇到各種錯誤代碼,其中錯誤3114是比較常見的一個。此錯誤一般涉及資料庫連結的問題,可能導致存取資料庫時出現異常狀況。本文將對Oracle錯誤3114進行解讀,探討其造成的原因,並給出解決該錯誤的具體方法以及相關的程式碼範例。 1.錯誤3114的定義Oracle錯誤3114通

http請求報錯:SocketError的解決方法在進行網路請求時,我們常常會遇到各種各樣的錯誤,其中一個常見的問題就是SocketError。當我們的應用程式無法與伺服器建立連線時,就會拋出這個錯誤。在本文中,我們將討論SocketError的一些常見原因和解決方法。首先,我們要了解Socket是什麼。 Socket是一種通訊協議,它允許應用程式通過
