我是 PHP 新手,并试图学习足够的知识来完成一些基本功能。我已经能够为我的用户创建一个表格来编辑自己并重新显示,但我遇到了一个问题。使用下面的脚本,用户可以输入他们对各种产品的技能水平。我希望能够突出显示他们输入“0”或空白的每个单元格。用户的输入将介于 0-5 之间(如果尚未填写,则为空白)。
这一切都是在我的本地主机上完成的,所以我承认所有的安全措施都不在那里。
我已经阅读了很多帖子并试图自己弄清楚,但我相信我在做一些根本错误的事情。
对此的任何帮助将不胜感激。众所周知,我会为那些帮助我编码的人买啤酒(通过贝宝):)
这是我现有的用于打印数据库结果的代码:
<?php
//This will connect to the database in order to begin this page
mysql_connect("localhost", "root", "time2start") or die (mysql_error());
//Now we will select the database we need to talk to
mysql_select_db("joomla_dev_15") or die (mysql_error());
$query = "SELECT * FROM enterprise_storage WHERE id=1";
$result = mysql_query($query) or die (mysql_error());
echo "<table border='1'>";
echo "$row";
echo "<tr> <th>Product</th> <th>Wayne Beeg</th> <th>Paul Hamke</th> <th>Steve Jaczyk</th> <th>David Jontow</th> <th>Ed MacDonald</th> <th>Michael Munozcano</th> <th>Ron Shaffer</th> <th>Luke Soares</th> <th>Josh Wenger</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['model'];
echo "</td><td>";
echo $row['beeg'];
echo "</td><td>";
echo $row['hamke'];
echo "</td><td>";
echo $row['jaczyk'];
echo "</td><td>";
echo $row['jontow'];
echo "</td><td>";
echo $row['macdonald'];
echo "</td><td>";
echo $row['munozcano'];
echo "</td><td>";
echo $row['shaffer'];
echo "</td><td>";
echo $row['soares'];
echo "</td><td>";
echo $row['wenger'];
echo "</td></tr>";
}
echo "</table>";
?>
<FORM>
<INPUT TYPE="BUTTON" VALUE="Return to the Home Page" ONCLICK="window.location.href='http://localhost/~user/joomla15/custom/skilldisplay.php'">
</FORM>