无法杀死正在破坏php连接的mysql查询[关闭]

问题描述 投票:-2回答:2
主要问题:PHP代码未运行。即使该代码之前已100%起作用。它突然停止工作了一点。不确定确切原因或方式。我试图终止查询,但没有成功。

[伙计们,所以我有一个工作正常的网站,然后php停止在该网站上工作。所以我做了一些研究,发现我应该终止查询。因此,我做了所有所有不同的网站和答案所说的,以显示进程列表并中止查询,但是每一次它说“ phpMyAdmin无法中止线程23219138。

可能已经关闭。不知道怎么问。如果您需要任何澄清,请告诉我。以下是我网站顶部的代码。它完美地运行文件,直到?php点,然后完全停止。

我们需要一些维护,我们应该尽快恢复。抱歉等待。

这是我的代码:

<!--<table class="standings" align="center"> <tr id="even"> <th class="head">Position</th> <th class="head">Points</th> <th class="head">Last Name</th> <th class="head">First Name</th> <th class="head">Residence</th> <th class="head">Winner</th> </tr>--> <?php $con=mysqli_connect('localhost', 'itorras', '****','my_db'); if(!$con) { die('Could not connect: ' . mysqli_error()); } $strSQL= "SELECT * FROM Brackets ORDER BY Points DESC"; $rs=mysqli_query($con,$strSQL); $i=1; $position = 1; while($row=mysqli_fetch_array($rs)) { if($row['Points'] != $currentPoints){ $position = $i; } if($i%2==0){ echo "<tr class='odd'><td>$position</td><td>" . $row['Points'] . "</td><td>" . $row['LastName'] . "</td><td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['Living'] . "</td><td>" . $row['Champion'] . "</td></tr>"; } if($i%2==1){ echo "<tr class='even'><td>$position</td><td>" . $row['Points'] . "</td><td>" . $row['LastName'] . "</td><td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['Living'] . "</td><td>" . $row['Champion'] . "</td></tr>"; } $i=$i+1; $currentPoints = $row['Points']; } mysqli_close($con); ?> </table> </div>

编辑:已添加SQL转储

-- phpMyAdmin SQL Dump -- version 4.0.8 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: May 21, 2014 at 12:58 PM -- Server version: 5.5.34-cll-lve -- PHP Version: 5.3.17 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `my_db` -- -- -------------------------------------------------------- -- -- Table structure for table `Brackets` -- CREATE TABLE IF NOT EXISTS `Brackets` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `LastName` varchar(15) DEFAULT NULL, `FirstName` varchar(15) DEFAULT NULL, `Email` varchar(30) DEFAULT NULL, `Living` varchar(30) DEFAULT NULL, `Points` int(11) DEFAULT NULL, `Home1` int(11) DEFAULT NULL, `Away1` int(11) DEFAULT NULL, `Home2` int(11) DEFAULT NULL, `Away2` int(11) DEFAULT NULL, `Home3` int(11) DEFAULT NULL, `Away3` int(11) DEFAULT NULL, `Home4` int(11) DEFAULT NULL, `Away4` int(11) DEFAULT NULL, `Home5` int(11) DEFAULT NULL, `Away5` int(11) DEFAULT NULL, `Home6` int(11) DEFAULT NULL, `Away6` int(11) DEFAULT NULL, `Home7` int(11) DEFAULT NULL, `Away7` int(11) DEFAULT NULL, `Home8` int(11) DEFAULT NULL, `Away8` int(11) DEFAULT NULL, `Home9` int(11) DEFAULT NULL, `Away9` int(11) DEFAULT NULL, `Home10` int(11) DEFAULT NULL, `Away10` int(11) DEFAULT NULL, `Home11` int(11) DEFAULT NULL, `Away11` int(11) DEFAULT NULL, `Home12` int(11) DEFAULT NULL, `Away12` int(11) DEFAULT NULL, `Home13` int(11) DEFAULT NULL, `Away13` int(11) DEFAULT NULL, `Home14` int(11) DEFAULT NULL, `Away14` int(11) DEFAULT NULL, `Home15` int(11) DEFAULT NULL, `Away15` int(11) DEFAULT NULL, `Home16` int(11) DEFAULT NULL, `Away16` int(11) DEFAULT NULL, `Home17` int(11) DEFAULT NULL, `Away17` int(11) DEFAULT NULL, `Home18` int(11) DEFAULT NULL, `Away18` int(11) DEFAULT NULL, `Home19` int(11) DEFAULT NULL, `Away19` int(11) DEFAULT NULL, `Home20` int(11) DEFAULT NULL, `Away20` int(11) DEFAULT NULL, `Home21` int(11) DEFAULT NULL, `Away21` int(11) DEFAULT NULL, `Home22` int(11) DEFAULT NULL, `Away22` int(11) DEFAULT NULL, `Home23` int(11) DEFAULT NULL, `Away23` int(11) DEFAULT NULL, `Home24` int(11) DEFAULT NULL, `Away24` int(11) DEFAULT NULL, `Home25` int(11) DEFAULT NULL, `Away25` int(11) DEFAULT NULL, `Home26` int(11) DEFAULT NULL, `Away26` int(11) DEFAULT NULL, `Home27` int(11) DEFAULT NULL, `Away27` int(11) DEFAULT NULL, `Home28` int(11) DEFAULT NULL, `Away28` int(11) DEFAULT NULL, `Home29` int(11) DEFAULT NULL, `Away29` int(11) DEFAULT NULL, `Home30` int(11) DEFAULT NULL, `Away30` int(11) DEFAULT NULL, `Home31` int(11) DEFAULT NULL, `Away31` int(11) DEFAULT NULL, `Home32` int(11) DEFAULT NULL, `Away32` int(11) DEFAULT NULL, `Home33` int(11) DEFAULT NULL, `Away33` int(11) DEFAULT NULL, `Home34` int(11) DEFAULT NULL, `Away34` int(11) DEFAULT NULL, `Home35` int(11) DEFAULT NULL, `Away35` int(11) DEFAULT NULL, `Home36` int(11) DEFAULT NULL, `Away36` int(11) DEFAULT NULL, `Home37` int(11) DEFAULT NULL, `Away37` int(11) DEFAULT NULL, `Home38` int(11) DEFAULT NULL, `Away38` int(11) DEFAULT NULL, `Home39` int(11) DEFAULT NULL, `Away39` int(11) DEFAULT NULL, `Home40` int(11) DEFAULT NULL, `Away40` int(11) DEFAULT NULL, `Home41` int(11) DEFAULT NULL, `Away41` int(11) DEFAULT NULL, `Home42` int(11) DEFAULT NULL, `Away42` int(11) DEFAULT NULL, `Home43` int(11) DEFAULT NULL, `Away43` int(11) DEFAULT NULL, `Home44` int(11) DEFAULT NULL, `Away44` int(11) DEFAULT NULL, `Home45` int(11) DEFAULT NULL, `Away45` int(11) DEFAULT NULL, `Home46` int(11) DEFAULT NULL, `Away46` int(11) DEFAULT NULL, `Home47` int(11) DEFAULT NULL, `Away47` int(11) DEFAULT NULL, `Home48` int(11) DEFAULT NULL, `Away48` int(11) DEFAULT NULL, `1GroupA` varchar(15) DEFAULT NULL, `2GroupA` varchar(15) DEFAULT NULL, `1GroupB` varchar(15) DEFAULT NULL, `2GroupB` varchar(15) DEFAULT NULL, `1GroupC` varchar(15) DEFAULT NULL, `2GroupC` varchar(15) DEFAULT NULL, `1GroupD` varchar(15) DEFAULT NULL, `2GroupD` varchar(15) DEFAULT NULL, `1GroupE` varchar(15) DEFAULT NULL, `2GroupE` varchar(15) DEFAULT NULL, `1GroupF` varchar(15) DEFAULT NULL, `2GroupF` varchar(15) DEFAULT NULL, `1GroupG` varchar(15) DEFAULT NULL, `2GroupG` varchar(15) DEFAULT NULL, `1GroupH` varchar(15) DEFAULT NULL, `2GroupH` varchar(15) DEFAULT NULL, `Quarter1` varchar(15) DEFAULT NULL, `Quarter2` varchar(15) DEFAULT NULL, `Quarter3` varchar(15) DEFAULT NULL, `Quarter4` varchar(15) DEFAULT NULL, `Quarter5` varchar(15) DEFAULT NULL, `Quarter6` varchar(15) DEFAULT NULL, `Quarter7` varchar(15) DEFAULT NULL, `Quarter8` varchar(15) DEFAULT NULL, `Semi1` varchar(15) DEFAULT NULL, `Semi2` varchar(15) DEFAULT NULL, `Semi3` varchar(15) DEFAULT NULL, `Semi4` varchar(15) DEFAULT NULL, `Third` varchar(15) DEFAULT NULL, `Final1` varchar(15) DEFAULT NULL, `Final2` varchar(15) DEFAULT NULL, `Champion` varchar(15) DEFAULT NULL, `TopScorer` varchar(15) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=28 ; -- -- Dumping data for table `Brackets` -- INSERT INTO `Brackets` (`id`, `LastName`, `FirstName`, `Email`, `Living`, `Points`, `Home1`, `Away1`, `Home2`, `Away2`, `Home3`, `Away3`, `Home4`, `Away4`, `Home5`, `Away5`, `Home6`, `Away6`, `Home7`, `Away7`, `Home8`, `Away8`, `Home9`, `Away9`, `Home10`, `Away10`, `Home11`, `Away11`, `Home12`, `Away12`, `Home13`, `Away13`, `Home14`, `Away14`, `Home15`, `Away15`, `Home16`, `Away16`, `Home17`, `Away17`, `Home18`, `Away18`, `Home19`, `Away19`, `Home20`, `Away20`, `Home21`, `Away21`, `Home22`, `Away22`, `Home23`, `Away23`, `Home24`, `Away24`, `Home25`, `Away25`, `Home26`, `Away26`, `Home27`, `Away27`, `Home28`, `Away28`, `Home29`, `Away29`, `Home30`, `Away30`, `Home31`, `Away31`, `Home32`, `Away32`, `Home33`, `Away33`, `Home34`, `Away34`, `Home35`, `Away35`, `Home36`, `Away36`, `Home37`, `Away37`, `Home38`, `Away38`, `Home39`, `Away39`, `Home40`, `Away40`, `Home41`, `Away41`, `Home42`, `Away42`, `Home43`, `Away43`, `Home44`, `Away44`, `Home45`, `Away45`, `Home46`, `Away46`, `Home47`, `Away47`, `Home48`, `Away48`, `1GroupA`, `2GroupA`, `1GroupB`, `2GroupB`, `1GroupC`, `2GroupC`, `1GroupD`, `2GroupD`, `1GroupE`, `2GroupE`, `1GroupF`, `2GroupF`, `1GroupG`, `2GroupG`, `1GroupH`, `2GroupH`, `Quarter1`, `Quarter2`, `Quarter3`, `Quarter4`, `Quarter5`, `Quarter6`, `Quarter7`, `Quarter8`, `Semi1`, `Semi2`, `Semi3`, `Semi4`, `Third`, `Final1`, `Final2`, `Champion`, `TopScorer`) VALUES (1, 'Torras', 'Ignacio', '[email protected]', 'USA', 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 'Brazil', 'Croatia', 'Spain', 'Netherlands', 'Colombia', 'Greece', 'Uruguay', 'Costa Rica', 'Switzerland', 'Ecuador', 'Argentina', 'Bosnia', 'Germany', 'Portugal', 'Belgium', 'Algeria', 'Brazil', 'Argentina', 'Spain', 'Netherlands', 'Uruguay', 'Germany', '', '', 'Argentina', 'Belgium', 'Brazil', 'Spain', 'Spain', 'Argentina', 'Brazil', 'Argentina', 'Messi'), (2, 'Lombana', 'Pablo', '[email protected]', 'Mexico', 0, 2, 1, 3, 1, 3, 2, 4, 0, 2, 0, 3, 0, 3, 1, 2, 2, 2, 1, 1, 0, 3, 0, 1, 2, 2, 1, 1, 2, 2, 0, 2, 1, 2, 1, 1, 2, 2, 2, 1, 2, 2, 0, 1, 1, 2, 2, 3, 1, 1, 1, 0, 0, 2, 1, 1, 0, 3, 0, 1, 1, 2, 1, 2, 0, 1, 3, 2, 2, 0, 4, 2, 2, 1, 2, 2, 2, 2, 3, 1, 1, 0, 1, 1, 2, 1, 1, 2, 2, 2, 2, 3, 2, 1, 3, 1, 2, 'Brazil', 'Mexico', 'Spain', 'Chile', 'Colombia', 'Ivory Coast', 'Uruguay', 'Italy', 'France', 'Switzerland', 'Argentina', 'Nigeria', 'Germany', 'USA', 'Belgium', 'Russia', 'Brazil', 'Argentina', 'Spain', 'Italy', 'France', 'Germany', 'Uruguay', '', 'Brazil', 'Germany', 'Spain', 'Argentina', 'Brazil', 'Germany', 'Spain', 'Germany', 'Messi'), (9, 'Ruiz', 'Mauricio', '[email protected]', 'USA', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Argentina', NULL), (11, 'Torras', 'Jose Luis', '[email protected]', 'Brazil', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Spain', NULL), (12, 'Tellez', 'Santi', '[email protected]', 'USA', 0, 3, 1, 2, 0, 1, 0, 2, 0, 2, 1, 1, 0, 2, 0, 1, 1, 2, 1, 4, 0, 2, 0, 0, 1, 3, 0, 2, 2, 5, 0, 2, 1, 1, 1, 1, 2, 2, 1, 0, 2, 2, 0, 1, 0, 2, 0, 4, 0, 2, 2, 0, 1, 3, 0, 0, 1, 4, 0, 1, 2, 1, 1, 1, 0, 0, 2, 0, 3, 1, 4, 2, 2, 0, 1, 0, 2, 2, 2, 0, 3, 0, 2, 2, 3, 1, 3, 2, 0, 0, 2, 3, 1, 0, 2, 0, 2, 'Mexico', 'Brazil', 'Spain', 'Netherlands', 'Colombia', 'Ivory Coast', 'Uruguay', 'Italy', 'France', 'Switzerland', 'Argentina', 'Bosnia', 'Germany', 'Portugal', 'Belgium', 'Russia', 'Mexico', 'Italy', 'France', 'Germany', 'Brazil', 'Uruguay', 'Argentina', 'Belgium', 'Mexico', 'Germany', 'Brazil', 'Argentina', 'Argentina', 'Mexico', 'Brazil', 'Mexico', 'Hernandez'), (13, 'Martinez', 'Andres', NULL, 'USA', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Brazil', NULL), (14, 'Chen', 'Andy', NULL, 'China', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Brazil', NULL), (15, 'Adams', 'Ben', NULL, 'USA', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Germany', NULL), (16, 'Walker', 'Jacob', NULL, 'USA', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'USA', NULL), (17, 'Alonso', 'Alejandro', NULL, 'Mexico', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Spain', NULL), (18, 'Torras', 'Ignacio Sr', '[email protected]', 'USA', 0, 3, 0, 2, 0, 2, 0, 4, 1, 2, 1, 1, 0, 3, 0, 0, 0, 1, 1, 3, 0, 3, 0, 0, 4, 3, 1, 1, 2, 3, 0, 0, 0, 2, 1, 2, 1, 1, 0, 1, 2, 3, 0, 1, 0, 1, 0, 0, 0, 1, 2, 0, 1, 7, 0, 1, 1, 3, 1, 1, 0, 1, 0, 0, 0, 1, 3, 0, 5, 0, 2, 0, 5, 0, 3, 0, 2, 0, 0, 1, 2, 1, 1, 1, 2, 1, 1, 2, 0, 0, 2, 1, 1, 0, 2, 1, 3, 'Brazil', 'Mexico', 'Spain', 'Chile', 'Colombia', 'Ivory Coast', 'Uruguay', 'England', 'France', 'Ecuador', 'Argentina', 'Nigeria', 'Germany', 'USA', 'Belgium', 'Russia', 'Brazil', 'Colombia', 'France', 'Germany', 'Spain', 'Uruguay', 'Argentina', 'USA', 'Brazil', 'Germany', 'Spain', 'Argentina', 'Spain', 'Germany', 'Argentina', 'Argentina', 'Messi'), (19, 'Demetriadi', 'Guy', '[email protected]', 'England', 0, 3, 1, 2, 0, 2, 1, 2, 0, 1, 0, 2, 1, 2, 1, 1, 1, 1, 2, 3, 1, 4, 0, 0, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 1, 1, 2, 1, 1, 3, 2, 0, 0, 0, 1, 1, 2, 1, 1, 3, 2, 2, 4, 0, 2, 1, 2, 1, 0, 2, 2, 1, 1, 1, 1, 3, 1, 1, 0, 4, 1, 1, 1, 2, 1, 1, 1, 2, 0, 2, 1, 1, 1, 1, 1, 4, 2, 0, 0, 3, 2, 2, 1, 3, 1, 3, 'Brazil', 'Mexico', 'Spain', 'Netherlands', 'Colombia', 'Ivory Coast', 'Uruguay', 'England', 'France', 'Ecuador', 'Argentina', 'Nigeria', 'Germany', 'Ghana', 'Belgium', 'Russia', 'Brazil', 'England', 'France', 'Germany', 'Spain', 'Uruguay', '', 'Belgium', 'Brazil', 'Germany', 'Spain', 'Argentina', 'Argentina', 'Brazil', 'Spain', 'Brazil', 'Messi'), (21, 'Burck', 'Davis', '[email protected]', 'USA', 0, 3, 1, 1, 1, 3, 1, 2, 0, 1, 1, 2, 1, 2, 0, 2, 2, 1, 1, 2, 0, 3, 0, 1, 1, 2, 1, 1, 2, 3, 0, 2, 2, 2, 0, 1, 2, 1, 0, 1, 2, 1, 0, 0, 1, 1, 0, 3, 1, 1, 2, 2, 2, 2, 0, 1, 2, 3, 1, 2, 2, 2, 1, 1, 1, 0, 3, 1, 2, 0, 4, 2, 2, 1, 2, 2, 1, 1, 1, 1, 3, 1, 1, 1, 3, 0, 2, 1, 1, 1, 3, 3, 1, 0, 2, 0, 1, 'Brazil', 'Mexico', 'Spain', 'Netherlands', 'Colombia', 'Ivory Coast', 'Uruguay', 'Italy', 'France', 'Switzerland', 'Argentina', 'Bosnia', 'Germany', 'Portugal', 'Belgium', 'Russia', 'Brazil', 'Italy', 'France', 'Germany', 'Spain', 'Uruguay', 'Argentina', 'Belgium', 'Brazil', 'Germany', 'Uruguay', 'Argentina', 'Brazil', 'Germany', 'Argentina', 'Germany', 'Higuain'), (22, 'Torras', 'Isabel', '[email protected]', 'USA', 0, 2, 1, 2, 1, 2, 1, 1, 0, 1, 2, 2, 1, 1, 0, 2, 1, 0, 1, 2, 0, 2, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 1, 3, 1, 2, 0, 2, 0, 0, 3, 1, 0, 1, 2, 0, 2, 2, 0, 0, 2, 0, 1, 2, 0, 2, 1, 2, 0, 1, 2, 0, 2, 1, 1, 2, 1, 2, 2, 1, 2, 3, 1, 1, 2, 1, 2, 3, 1, 1, 3, 1, 1, 1, 2, 2, 3, 1, 0, 0, 2, 2, 1, 2, 1, 2, 2, 'Brazil', 'Mexico', 'Spain', 'Netherlands', 'Colombia', 'Ivory Coast', 'Italy', 'England', 'France', 'Ecuador', 'Argentina', 'Nigeria', 'Germany', 'Ghana', 'Korea', 'Russia', 'Brazil', 'Mexico', 'Argentina', 'France', 'Germany', 'Nigeria', '', 'Spain', 'Brazil', 'Germany', 'Spain', 'Argentina', 'Germany', 'Spain', 'Brazil', 'Brazil', 'Messi'), (23, 'Roger', 'Luis', '[email protected]', 'USA', 0, 1, 1, 2, 0, 2, 1, 2, 0, 2, 3, 2, 2, 2, 3, 1, 2, 1, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 1, 0, 2, 0, 1, 2, 1, 0, 1, 2, 2, 2, 2, 1, 3, 2, 2, 3, 1, 1, 2, 2, 3, 1, 2, 1, 2, 2, 3, 1, 1, 2, 1, 2, 1, 3, 1, 0, 2, 3, 2, 3, 1, 2, 2, 1, 2, 2, 4, 1, 2, 3, 2, 0, 2, 1, 1, 2, 2, 2, 1, 0, 'Brazil', 'Mexico', 'Spain', 'Netherlands', 'Ivory Coast', 'Colombia', 'Uruguay', 'England', 'France', 'Ecuador', 'Argentina', 'Iran', 'USA', 'Germany', 'Belgium', 'Russia', 'Brazil', 'Ivory Coast', 'France', 'USA', 'Spain', 'Uruguay', '', 'Germany', 'Brazil', 'Iran', 'Spain', 'Argentina', 'Spain', 'Brazil', 'Spain', 'Spain', 'Villa'), (24, 'Campana ', 'Guillermo', '[email protected]', 'USA', 0, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 3, 0, 1, 2, 1, 2, 4, 1, 2, 1, 0, 3, 2, 1, 1, 2, 3, 1, 2, 1, 3, 2, 1, 2, 2, 1, 1, 2, 2, 0, 3, 2, 2, 1, 3, 1, 1, 2, 0, 4, 4, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 0, 2, 1, 1, 0, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 3, 0, 3, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 1, 3, 'Brazil', 'Croatia', 'Spain', 'Chile', 'Colombia', 'Japan', 'Uruguay', 'Italy', 'Ecuador', 'France', 'Argentina', 'Bosnia', 'Germany', 'USA', 'Belgium', 'Russia', 'Brazil', 'Colombia', 'Bosnia', 'Germany', 'Spain', 'Uruguay', '', 'Belgium', 'Brazil', 'Germany', 'Uruguay', 'Argentina', 'Argentina', 'Germany', 'Argentina', 'Brazil', 'Suarez'), (25, 'Chapman', 'Paul', '[email protected]', 'USA', 0, 2, 0, 1, 0, 2, 1, 0, 0, 2, 0, 1, 0, 3, 0, 1, 1, 1, 0, 2, 0, 2, 0, 0, 1, 2, 1, 0, 1, 2, 0, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 1, 0, 1, 2, 0, 1, 1, 1, 0, 0, 2, 1, 1, 1, 0, 0, 2, 1, 1, 0, 1, 2, 1, 0, 2, 1, 2, 0, 1, 1, 2, 0, 2, 0, 1, 0, 2, 1, 0, 0, 2, 1, 1, 0, 1, 0, 1, 'Brazil', 'Croatia', 'Spain', 'Netherlands', 'Colombia', 'Ivory Coast', 'Uruguay', 'England', 'France', 'Switzerland', 'Argentina', 'Bosnia', 'Germany', 'Portugal', 'Belgium', 'Korea', 'Brazil', 'England', 'France', 'Germany', 'Uruguay', 'Argentina', 'Portugal', 'Spain', 'Brazil', 'Germany', 'Spain', 'Argentina', 'Germany', 'Brazil', 'Spain', 'Brazil', 'Neymar'), (26, 'Evans', 'Will ', '[email protected]', 'USA', 0, 2, 0, 2, 1, 1, 0, 1, 1, 1, 1, 2, 3, 2, 0, 1, 1, 1, 1, 2, 0, 3, 0, 0, 1, 2, 1, 2, 0, 3, 0, 1, 1, 3, 0, 0, 1, 2, 0, 0, 2, 1, 0, 1, 1, 2, 1, 2, 0, 0, 1, 1, 1, 3, 0, 2, 1, 2, 1, 1, 3, 2, 0, 1, 0, 0, 3, 1, 1, 0, 3, 2, 1, 1, 0, 1, 2, 1, 2, 0, 2, 1, 2, 0, 3, 0, 2, 0, 0, 1, 2, 2, 1, 1, 2, 0, 1, 'Brazil', 'Croatia', 'Spain', 'Netherlands', 'Japan', 'Ivory Coast', 'Uruguay', 'England', 'France', 'Switzerland', 'Argentina', 'Nigeria', 'Germany', 'Portugal', 'Belgium', 'Korea', 'Brazil', 'England', 'France', 'Germany', 'Spain', 'Uruguay', 'Argentina', 'Belgium', 'Brazil', 'Germany', 'Spain', 'Belgium', 'Germany', 'Brazil', 'Spain', 'Brazil', 'Neymar'), (27, 'Torras', 'Miguel ', '[email protected]', 'Spain', 0, 2, 0, 1, 0, 1, 1, 2, 1, 0, 0, 0, 1, 3, 0, 1, 1, 0, 0, 3, 0, 2, 1, 0, 1, 3, 2, 1, 3, 3, 0, 2, 0, 3, 1, 0, 0, 3, 0, 0, 2, 3, 0, 1, 2, 1, 3, 2, 0, 1, 3, 0, 1, 3, 0, 2, 1, 2, 0, 1, 2, 0, 2, 2, 0, 0, 3, 1, 1, 0, 3, 2, 1, 2, 0, 1, 0, 0, 0, 0, 2, 1, 1, 1, 2, 1, 4, 1, 0, 2, 2, 2, 0, 0, 1, 1, 1, 'Brazil', 'Mexico', 'Spain', 'Netherlands', 'Greece', 'Japan', 'England', 'Italy', 'France', 'Ecuador', 'Argentina', 'Nigeria', 'Germany', 'Portugal', 'Russia', 'Belgium', 'Brazil', 'Italy', 'France', 'Germany', 'Spain', 'England', 'Argentina', 'Portugal', 'Brazil', 'Germany', 'Spain', 'Argentina', 'Argentina', 'Brazil', 'Spain', 'Brazil', 'Messi'); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
php mysql sql
2个回答
0
投票
您对查询没有错误检查。那里很有可能快要死了。

$strSQL= "SELECT * FROM Brackets ORDER BY Points DESC"; if($rs=mysqli_query($con,$strSQL)) { //run your while statement and output your table here } else { die(mysqli_error($con)); }

此外,您也可以简化行生成代码,而不是重复行生成代码

$class = $i%2==0 ? "odd" : "even"; echo "<tr class='{$class}'><td>$position</td><td>" . $row['Points'] . "</td><td>" . $row['LastName'] . "</td><td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['Living'] . "</td><td>" . $row['Champion'] . "</td></tr>";


0
投票
在此运行

$con2=mysqli_connect('localhost', 'root','','test'); if(!$con2) { die('Could not connect: ' . mysqli_error()); } $strSQL= "SELECT * FROM Brackets ORDER BY Points DESC"; $rs=mysqli_query($con2,$strSQL); $i=1; $position = 1; $currentPoints = 100; //try adding this here while($row=mysqli_fetch_assoc($rs)) { if($row['Points'] != $currentPoints){ $position = $i; } if($i%2==0){ echo "<tr class='odd'><td>$position</td><td>" . $row['Points'] . "</td><td>" . $row['LastName'] . "</td><td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['Living'] . "</td><td>" . $row['Champion'] . "</td></tr>"; } if($i%2==1){ echo "<tr class='even'><td>$position</td><td>" . $row['Points'] . "</td><td>" . $row['LastName'] . "</td><td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['Living'] . "</td><td>" . $row['Champion'] . "</td></tr>"; } $i=$i+1; $currentPoints = $row['Points']; } mysqli_close($con2);

© www.soinside.com 2019 - 2024. All rights reserved.