Discuz! info: MySQL Query Error
User: Bamdyc
Time: 2005-5-16 9:53pm
Script: /z_cup.php
SQL: SELECT username, money FROM ORDER BY money DESC LIMIT 10
Error: You have an error in your SQL syntax near 'ORDER BY money DESC LIMIT 10' at line 1
Errno.: 1064
Similar error report has beed dispatched to administrator before.
代码为<?
/***********************************************************************/
/* */
/* DISCUZ! v2.x 足彩插件 2.0 */
/* */
/* 程序开发:Winter0706(rubbishman) */
/* 鸣谢: qqboy1017 (QQBoy) */
/* 联系电邮: winter0706@gmail.com */
/* 技朮支持: http://www.freediscuz.net */
/* https://discuz.dismall.com */
/* 使用声明: 此乃为 DISCUZ! v2.x 系统所开发的足彩开源插件,欢迎使用。 */
/* */
/***********************************************************************/
require 'z_config.php';
require $discuz_root.'./include/common.php';
$discuz_action = 230;
if(!$discuz_uid || !$discuz_pw) {
showmessage('not_loggedin');
}
$username = $discuz_user;
if(!empty($z_admin)){
$iszadmin = 0;
if(strpos($z_admin, ",")) {
foreach(explode(",", $z_admin) as $zad) {
$zad = trim($zad);
if ($zad == $discuz_user) $iszadmin = 1;
}
} else {
$zad = trim($z_admin);
if ($zad == $discuz_user) $iszadmin = 1;
}
} else {
$iszadmin = 0;
}
if ($isadmin) $iszadmin = 1;
if (!$isadmin && $z_closed) showmessage('对不起,足彩系统正在进行维护暂时关闭。请稍后再来。');
$query = $db->query("SELECT username, money FROM $table_z_cup_winuser ORDER BY money DESC LIMIT 10");
$userlist = array();
$num = 1;
while($users = $db->fetch_array($query)) {
$users[num] = $num;
$userlist[] = $users;
$num += 1;
}
$rnum = 1;
$query = $db->query("SELECT g.id as id, g.hteam as hteam, g.vteam as vteam, g.gamedate as gamedate, g.score as score, c.gameclass as gameclass FROM $table_z_cup_game g LEFT JOIN $table_z_cup_class c ON g.gameclass=c.id WHERE g.ending<>'0' ORDER BY g.gamedate DESC, g.gametime DESC LIMIT 6");
$endlist = array();
while($end = $db->fetch_array($query)) {
$endlist[] = $end;
$rnum += 1;
}
$bnum = 1;
$query = $db->query("SELECT g.id as id, g.hteam as hteam, g.vteam as vteam, g.gamedate as gamedate, g.info as info, g.gametime as gametime, g.hteamrate as hteamrate, g.vteamrate as vteamrate, g.equalrate as equalrate, c.gameclass as gameclass FROM $table_z_cup_game g LEFT JOIN $table_z_cup_class c ON g.gameclass=c.id WHERE g.ending='0' ORDER BY g.gamedate, g.gametime LIMIT 2");
$gamelist = array();
while($games = $db->fetch_array($query)) {
$gamelist[] = $games;
$bnum += 1;
} |