ホームページ  >  記事  >  バックエンド開発  >  destoonレプリケーションモジュールでmysqlエラーが発生しました。マスターに解決を依頼してください。

destoonレプリケーションモジュールでmysqlエラーが発生しました。マスターに解決を依頼してください。

WBOY
WBOYオリジナル
2016-06-23 13:54:001519ブラウズ

MySQL クエリ:SELECT * FROM [pre]vipcenter_25 WHERE status=3 ORDER BY LIMIT 0,20
MySQL エラー: SQL 構文にエラーがあります。使用する正しい構文については、MySQL サーバーのバージョンに対応するマニュアルを確認してください。 1 行目の「LIMIT 0,20」付近 MySQL Errno: 0 コード内のブランドはバッチで成功に置き換えられます。それ以外は問題ありませんが、このエラーはバックグラウンド モジュールの編集時に発生します



ディスカッションに返信 (解決策)

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 - SQL 構文にエラーがあります。MySQL サーバーのバージョンに対応するマニュアルを確認してください。 1 行目の '[pre]vipcenter_25' 付近で使用する正しい構文については、

SQL] SELECT * FROM [pre]vipcenter_25

[Err] 1064 - SQL 構文にエラーがあります。対応するマニュアルを確認してください。 1 行目の「[pre]vipcenter_25」付近で使用する正しい構文については、MySQL サーバーのバージョンに合わせてください。

テーブルの名前が正しく書かれていることを確認し、xx による順序で並べてください。 xx はテーブルのフィールド属性である必要があります。上記に追加していません。 1 行目の「[pre]vipcenter_25」付近で使用する正しい構文の SQL サーバーのバージョン

テーブルの名前が正しく書かれていることを確認し、xx による順序 xx はテーブルのフィールド属性である必要があります。上に追加しないでください。

本当ですか?


実は、私は初心者なのですが、元のモジュールのコードを完全にコピーして、データベースに新しいテーブルを作成しました。間違っています

実は、初心者なのでよくわかりませんが、元のモジュールのコードを完全にコピーして、データベースに新しいテーブルを作成しました

何が間違っていたのかわかりません。

テーブルの名前を正しく書いていることを確認してください。また、order by xx xx は、上で追加しなかったテーブルのフィールド属性である必要があります。
1.テーブル名から * を選択しますか?
2. 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 = define('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 ORD ER BY $order LIMIT $オフセット,$ページサイズ");
查{$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 [前]vipcenter_25也报错

表名字怎么会出现这个?


这个我也不明確,以前没学过php
源代码:


echo "SELECT * FROM {$this ->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize";
死ぬ();
再试试

9be469421ab6898e247ec16d57a534c1fields = array('catid','level','title','style','fee','introduce','areaid','thumb','homepage','status', 「ヒット数」、「ユーザー名」、「追加時間」、「追加日」、「編集者」、「編集時間」、「編集日」、「IP」、「テンプレート」、「リンクURL」、「ファイルパス」、「メモ」、「会社」 ','本当の名前','電話番号','携帯電話','アドレス','電子メール','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']) 7939856c2693008fa2844fad2d99ac96_(lang('message->pass_title'));
if(!$post['thumb']) return $this->_(lang('message->pass_logo'));
true を返します。
}

function set($post) {
global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
$post['editor'] = $_ユーザー名;
$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 .= 'c42e5b6da306d11e312d356e778f48f1';
$r = $this->get_one();
$old = $r['コンテンツ'];
if($r['thumb']) $old .= '504df05e94dd8e71fa85f6983347bdb6';
delete_diff($new, $old);
} else {
$post['ip'] = $DT_IP;
}
if(!define('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->アイテム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 = define('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'] : '';
}
}
}
$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['ステータス'] == 3 && $post['ユーザー名'] && $MOD['credit_add']) {
Credit_add($post['ユーザー名'], $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);
$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'] >gt; 2) $this->tohtml($this->itemid, $post['catid']);
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['ユーザー名'] ? 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);
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");
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)) リンク解除($_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'] a917419204619ccf7c11a8fc15c2d8efcredit_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);
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");
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)"); _($e) {
$this->errmsg = $e;
return false; }
}

?>

 

出力: SELECT * FROM destoon_vipcenter_25 WHERE status=3 ORDER BY LIMIT

echo "SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize";

もう一度試してください

この問題について何か投稿する必要があります 出力そうしないと、質問に答える方法がありません。

問題は解決しました。 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']) : ページ($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 の値を取得できません。$order の代わりに edittime DESC を使用するだけで問題なく実行されます。しかし、今は $order




echo “SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize” の値を取得できない理由がわかりません。 ;
die();

もう一度試してください

この問題の出力結果を投稿してください。そうしないと、質問に答えることができなくなります。

とにかく本当にありがとう!

この問題の理由を説明します。モジュールをコピーした後、メニューの下部にあるモジュール設定をクリックするだけでモジュールを設定しました。これは間違いなく正解です。コードを急いで変更する必要はありません。

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。