我当前正在建立一个页面,该页面使用while循环和访存数组从探路者网站的数据库创建可玩种族的表。我在其他页面上使用了相同的编码风格,但它们工作正常,但是我的两个页面却给了我“死亡的白屏”。这些页面在本地可以正常工作,但是当我与服务器连接时,它们只是不会在常规HTML内容之后加载。
我已经尝试过语法读取器,并通过仔细检查使它起作用,但是读取器没有出现问题,而且我自己也找不到问题。 PHP仍然有很多我不了解的地方。
但是,我确实添加了一些ini_set错误来显示代码,并得到了我所面临的错误。
我得到的是以下内容;
致命错误:未捕获错误:调用成员函数fetch_array() 在布尔 /home/vol1_2/epizy.com/epiz_24390026/htdocs/php/familiar.php:45堆栈 跟踪:抛出#0 {main} /home/vol1_2/epizy.com/epiz_24390026/htdocs/php/familiar.php在线 45
<?php $races= "SELECT name, image, type, italics, italics2, abilBio, speed,
senses, skills, spellLikeAbil, immune, resists, lang, size,
specAbil, weakness, weaponFam, SR, CMBCMD, AC, saves, attack, magic, natWeps
FROM playableraces WHERE raceID = '1'OR raceID = '3' OR raceID = '5'
OR raceID = '7' OR raceID = '9' OR raceID = '11'
OR raceID = '13'
ORDER BY name";
$result = $dbconn->query($races); ?>
<div id="content">
<h2>Playable Races</h2>
<p class="crP">Within the world of Pathfinder the typical races that players are able to select are Dwarves, Elves, Gnomes, Half-Elves, Half-Orcs, Halflings, & Humans, however, those aren't the only races that are available. Below players and dungeon/game masters alike will find many more options that are available to their player characters, and Non-playable Characters that are considered 'Monsters'.</p>
<div class="tableHolder">
<?php while ($data = $result->fetch_array(MYSQLI_ASSOC)) { ?>
<div class="gapMaker">
<button class="accordion"><img src="../images/label2.png" class="label"><span class="name"><?php echo ($data['name']); ?></span></button>
<div class="panel">
<div class="race">
<div class="racePicture">
<table>
<tr>
<td><img src="../images/<?php echo ($data['image']); ?>" alt="<?php echo ($data['italics']); ?>"></td>
</tr>
</table>
</div>
<div class="raceInfo">
<table class="generalRace">
<tr>
<td><?php echo ($data['size']);?></td>
</tr>
<tr>
<td><p>Type: <?php echo ($data['type']);?></p></td>
</tr>
<tr>
<td><?php echo ($data['senses']);?></td>
</tr>
</table>
</div>
<div class="raceSections">
<div class="sectionTitle2"><p>Defence</p></div>
<table>
<tr>
<td><p><?php echo ($data['AC']);?></p></td>
</tr>
<tr>
<td><p><?php echo ($data['saves']);?></p></td>
</tr>
<tr>
<td><p><?php echo ($data['weakness']);?></p></td>
</tr>
<tr>
<td><p><?php echo ($data['SR']);?></p></td>
</tr>
</table>
<div class="sectionTitle2"><p>Offence</p></div>
<table>
<tr>
<td><p><?php echo ($data['speed']);?></p></td>
</tr>
<tr>
<td><p><?php echo ($data['attack']);?></p></td>
</tr>
<tr>
<td><p><?php echo ($data['natWeps']);?></p></td>
</tr>
<tr>
<td><p><?php echo ($data['weaponFam']);?></p></td>
</tr>
<tr>
<td><p><?php echo ($data['magic']);?></p></td>
</tr>
</table>
<div class="sectionTitle2"><p>Statistics</p></div>
<table>
<tr>
<td><p><?php echo ($data['abilBio']);?></p></td>
</tr>
<tr>
<td><p><?php echo ($data['CMBCMD']);?></p></td>
</tr>
</table>
<div class="sectionTitle2"><p>Special Abiities</p></div>
<table>
<tr>
<td><p><?php echo ($data['specAbil']);?></p></td>
</tr>
</table>
</div>
<div class="sectionTitle2"><p>Description</p></div>
<div class="raceItalics">
<table>
<tr>
<td><p><?php echo ($data['italics']);?></p></td>
</tr>
<tr>
<td><p><?php echo ($data['italics2']);?></p></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<?php } ?></div>
所需的效果将显示所有想要的表,但是相反,在带有crP类的普通HTML p标签之后,我得到了白屏。