公布结果时出现问题!
Discuz! info: MySQL Query Error
User: shinychan
Time: 2006-1-19 9:53am
Script: /z_addending.php
SQL: SELECT COUNT(*) FROM cdb_z_cup_bswinuser WHERE username='shinychan'
Error: Table 'shinychanc_bbs.cdb_z_cup_bswinuser' doesn't exist
数据表缺失,请恢复备份数据
Similar error report has beed dispatched to administrator before.
我发觉以上一个很有趣的问题:
当公布赛果时,若公布1:1, 2:2:, 3:3, 4:4, 5:5, 6:6, 7:7等等的结果,就会显示以上的error语句!但若公布1:0, 2:0, 0:1(不是打和的赛果)就没有问题!
请问是否那个 z_addending.php 出现问题呀?现附上其内容如下,还望各位高手赐教!谢谢!
- <?
- /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*//*
- DISCUZ! v2/3/4.x 足彩插件 2.5
- 程序开发:Winter0706(rubbishman)/qqboy1017 (QQBoy)
- 联系电邮: winter0706@gmail.com
- 技术支持: https://discuz.dismall.com
- 使用声明: 此乃为 DISCUZ! v2/3/4.x 系统所开发的足彩开源插件,欢迎使用。
- *//*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
- require 'z_config.php';
- if(!$iszadmin) {
- showmessage('admin_nopermission');
- }
- if ($endid) {
- $score1 = "\$score1ofgame" . $endid;
- $score2 = "\$score2ofgame" . $endid;
- eval("\$score1 = "$score1";");
- eval("\$score2 = "$score2";");
- if($newscore1 < 0 || $newscore1 > 99 || $newscore2 < 0 || $newscore2 > 99){
- showmessage('比赛结果输入不正确,请重新输入!');
- }
- $fiscore1=$score1;
- $fiscore2=$score2;
- $query = $db->query("SELECT hteam, vteam, hteamrate, vteamrate, equalrate, gamedate, gametime,yqopen,yqtype,yqrate FROM {$tablepre}z_cup_game WHERE id = $endid");
- $ratedecide = $db->fetch_array($query);
- if($ratedecide[yqopen] && $ratedecide[yqtype]==1)$fiscore1=$fiscore1+$ratedecide[yqrate];
- if($ratedecide[yqopen] && $ratedecide[yqtype]==2)$fiscore2=$fiscore2+$ratedecide[yqrate];
- if ($fiscore1 > $fiscore2) {
- $ending = 1;
- } elseif ($fiscore1 < $fiscore2) {
- $ending = 2;
- } elseif ($fiscore1 == $fiscore2) {
- $ending = 3;
- }
- if ($score1 + $score2 >3) {
- $bsending = 1;
- } elseif ($score1 + $score2 <3) {
- $bsending = 2;
- } elseif ($score1 + $score2 == 3) {
- $bsending = 1;
- }
- $score = $fiscore1 . ":" . $fiscore2;
- $realscore= $score1 . ":" . $score2;
- $query = $db->query("UPDATE {$tablepre}z_cup_game SET score='$realscore', ending='$ending',bsending='$bsending' WHERE id = $endid");
- if ($ending == 1) {
- $rate = $ratedecide[hteamrate];
- } elseif ($ending == 2) {
- $rate = $ratedecide[vteamrate];
- } else {
- $rate = $ratedecide[equalrate];
- }
- $gdate = $ratedecide[gamedate];
- $query = $db->query("SELECT username, game2, duzhu FROM {$tablepre}z_cup_dudan WHERE gameid=$endid AND game1=$ending AND gametype='sc'");
- while($users = $db->fetch_array($query)) {
- $winmoney = $users[duzhu] * $rate;
- if ($score == $users[game2]) $winmoney *= 3;
- $winuser = $users[username];
- $db->query("UPDATE {$tablepre}members SET {$moneycolumn}={$moneycolumn}+$winmoney WHERE username='$winuser'");
- $db->query("INSERT INTO {$tablepre}z_cup_winnerlist (username, gameid, gametime, winmoney,gametype)
- VALUES ('$winuser', '$endid', '$gdate', '$winmoney','sc')");
- $query2 = $db->query("SELECT COUNT(*) FROM {$tablepre}z_cup_winuser WHERE username='$winuser'");
- $existentuser = $db->result($query2, 0);
- $winmoney -= $users[duzhu];
- if ($existentuser > 0) {
- $db->query("UPDATE {$tablepre}z_cup_winuser SET win=win+1, money=money+$winmoney WHERE username='$winuser'");
- } else {
- $db->query("INSERT INTO {$tablepre}z_cup_winuser (username, win, lost, money)
- VALUES ('$winuser', '1', '0', '$winmoney')");
- }
- $winmoney += $users[duzhu];
- }
- $query = $db->query("SELECT username, game2, duzhu FROM {$tablepre}z_cup_dudan WHERE gameid=$endid AND game1=$bsending AND gametype='bs'");
- while($users = $db->fetch_array($query)) {
- $winmoney = $users[duzhu] * 1.85;
- $winuser = $users[username];
- $db->query("UPDATE {$tablepre}members SET {$moneycolumn}={$moneycolumn}+$winmoney WHERE username='$winuser'");
- $db->query("INSERT INTO {$tablepre}z_cup_winnerlist (username, gameid, gametime, winmoney,gametype)
- VALUES ('$winuser', '$endid', '$gdate', '$winmoney','bs')");
- $query2 = $db->query("SELECT COUNT(*) FROM {$tablepre}z_cup_winuser WHERE username='$winuser'");
- $existentuser = $db->result($query2, 0);
- $winmoney -= $users[duzhu];
- if ($existentuser > 0) {
- $db->query("UPDATE {$tablepre}z_cup_winuser SET win=win+1, money=money+$winmoney WHERE username='$winuser'");
- } else {
- $db->query("INSERT INTO {$tablepre}z_cup_winuser (username, win, lost, money)
- VALUES ('$winuser', '1', '0', '$winmoney')");
- }
- $winmoney += $users[duzhu];
- }
- $query = $db->query("SELECT username, game2, duzhu FROM {$tablepre}z_cup_dudan WHERE gameid=$endid AND game1<>$ending AND gametype='sc'");
- while($users = $db->fetch_array($query)) {
- $lostmoney = $users[duzhu];
- $loseuser = $users[username];
- $query2 = $db->query("SELECT COUNT(*) FROM {$tablepre}z_cup_winuser WHERE username='$loseuser'");
- $existentuser = $db->result($query2, 0);
- if ($existentuser > 0) {
- $db->query("UPDATE {$tablepre}z_cup_winuser SET lost=lost+1, money=money-$lostmoney WHERE username='$loseuser'");
- } else {
- $db->query("INSERT INTO {$tablepre}z_cup_winuser (username, win, lost, money)
- VALUES ('$loseuser', '0', '1', '-$lostmoney')");
- }
- }
- $query = $db->query("SELECT username, game2, duzhu FROM {$tablepre}z_cup_dudan WHERE gameid=$endid AND game1<>$bsending AND gametype='bs'");
- while($users = $db->fetch_array($query)) {
- $lostmoney = $users[duzhu];
- $loseuser = $users[username];
- $query2 = $db->query("SELECT COUNT(*) FROM {$tablepre}z_cup_bswinuser WHERE username='$loseuser'");
- $existentuser = $db->result($query2, 0);
- if ($existentuser > 0) {
- $db->query("UPDATE {$tablepre}z_cup_winuser SET lost=lost+1, money=money-$lostmoney WHERE username='$loseuser'");
- } else {
- $db->query("INSERT INTO {$tablepre}z_cup_winuser (username, win, lost, money)
- VALUES ('$loseuser', '0', '1', '-$lostmoney')");
- }
- }
- $query = $db->query("UPDATE {$tablepre}members SET {$moneycolumn}={$moneycolumn}+{$salmon} WHERE username='$discuz_user'");
- showmessage("比赛已公布及派彩", "z_addending.php");
- }//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- if ($cutid) {
- $score = "腰斩";
- $query = $db->query("UPDATE {$tablepre}z_cup_game SET score='$score', ending='5' WHERE id = $cutid");
- $query = $db->query("SELECT username, duzhu FROM {$tablepre}z_cup_dudan WHERE gameid=$cutid AND gametype='sc'");
- while($users = $db->fetch_array($query)) {
- $winmoney = $users[duzhu] ;
- $winuser = $users[username];
- $db->query("UPDATE {$tablepre}members SET {$moneycolumn}={$moneycolumn}+$winmoney WHERE username='$winuser'");
- unset($winmoney,$winuser);
- } $query = $db->query("SELECT username, duzhu FROM {$tablepre}z_cup_dudan WHERE gameid=$cutid AND gametype='bs'");
- while($users = $db->fetch_array($query)) {
- $winmoney = $users[duzhu] ;
- $winuser = $users[username];
- $db->query("UPDATE {$tablepre}members SET {$moneycolumn}={$moneycolumn}+$winmoney WHERE username='$winuser'");
- unset($winmoney,$winuser);
- }
- $query = $db->query("UPDATE {$tablepre}members SET {$moneycolumn}={$moneycolumn}+{$salmon} WHERE username='$discuz_user'");
- showmessage("比赛已公布及派彩", "z_addending.php");
- }//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- $query = $db->query("SELECT g.id as id, g.hteam as hteam, g.vteam as vteam, g.gamedate as gamedate, g.gametime as gametime, c.gameclass as gameclass FROM {$tablepre}z_cup_game g LEFT JOIN {$tablepre}z_cup_class c ON g.gameclass=c.id WHERE g.ending='0' ORDER BY g.gamedate, g.gametime");
- $endlist = array();
- while($end = $db->fetch_array($query)) {
- $endlist[] = $end;
- }
- include template('z_addending');
- ?>
复制代码 |