-1

这是我的代码:

            echo "<td>" . $row4['CMUSERID'] . "</td>";
            echo "<td>" . $row4['CMCLAS'] . "</td>";
            echo "<td>" . $row4['CMRACE'] . "</td>";
            echo "<td>" . $row4['CMGEND'] . "</td>";
            echo "<td>" . $row4['CMSTRE'] . "</td>";
            echo "<td>" . $row4['CMDEXT'] . "</td>";
            echo "<td>" . $row4['CMCONS'] . "</td>";
            echo "<td>" . $row4['CMWISD'] . "</td>";

这是显示结果的页面的链接:

http://oge.sytes.net/zetzer/includes/characters.php

如何修改我的 php 代码以从显示中消除 PlayerClass 和 PlayerRace,所以如果他们没有选择班级或比赛,它会显示为空?我无法在数据库中更改它,因此必须在 php 显示中替换它

4

1 回答 1

1
        echo "<td>" . $row4['CMUSERID'] . "</td>";
        echo "<td>";
             echo $row4['CMCLAS'] == "PlayerClass" ? "&nbsp;" : $row4['CMCLAS'];
        echo "</td>";
        echo "<td>";
             echo $row4['CMRACE'] == "PlayerRace" ? "&nbsp;" : $row4['CMRACE'];
        echo "</td>";
        echo "<td>" . $row4['CMGEND'] . "</td>";
        echo "<td>" . $row4['CMSTRE'] . "</td>";
        echo "<td>" . $row4['CMDEXT'] . "</td>";
        echo "<td>" . $row4['CMCONS'] . "</td>";
        echo "<td>" . $row4['CMWISD'] . "</td>";

您可能想替换&nbsp;任何您喜欢的“”。

于 2013-04-19T06:10:57.243 回答