我目前正在开发一个项目,该项目从 mySQL 中提取表,这些表显示在 html 表中。下面你可以看到代码。
if (mysql_num_rows($result) > 0) {
// yes
// print them one after another
echo "<table cellpadding=1 border=1 width=100%>";
while($row = mysql_fetch_row($result)) {
echo "<tr>";
echo "<td>"."<center>".$row[0]."</center>"."</td>";
echo "<td>" .$row[2]."</td>";
echo "<td>" .$row[1]."</td>";
echo "<td>" .$row[3]."</td>";
echo "</tr>";
}
echo "</table>";
}
我需要将其更改为
if (mysql_num_rows($result) > 0) {
// yes
// print them one after another
echo "<table cellpadding=1 border=1 width=100%>";
while($row = mysql_fetch_row($result)) {
echo "<tr>";
echo "<td>"."<center>".$row[0]."</center>"."</td>";
echo "<td>" .$row[2]."</td>";
echo "<td>" .$row[1]."</td>";
echo "<td><font face="Georgia, Times New Roman, Times, serif">" .$row[3]."</font></td>";
echo "</tr>";
}
echo "</table>";
}
当我这样做时,会抛出错误。我这样做是为了让用户看到我有字体的条形码。
我做错了吗?还是有另一种更好的方法。
谢谢瑞恩