php - 在Mysql命令中使用时的字体颜色问题

标签 php mysql html

我使用的字体颜色为红色,但在我的页面中它显示为绿色。

<?php

include('connect-db.php');

$result = mysql_query("SELECT * FROM players") or die(mysql_error());

while($row = mysql_fetch_array( $result )) {     
    echo '<font color=\"red\">';              
    echo $row['firstname']  ;
    echo '</font>';
    echo ':';
    echo $row['lastname'] ;
    echo '<br><br>';
} 

?>

最佳答案

<?php

include('connect-db.php');

$result = mysql_query("SELECT * FROM players") or die(mysql_error());

while($row = mysql_fetch_array( $result )) {     
echo '<span style=\"color:red;\">';              
echo $row['firstname']  ;
echo '</span>';
echo ':';
echo $row['lastname'] ;
echo '<br><br>';
} 

?>

关于php - 在Mysql命令中使用时的字体颜色问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10958295/

相关文章:

php - 如何使用 PHP session 来防止重复表单提交?

PHP比较两个表的结果

JavaScript 以及为什么大写字母有时有效有时无效

php - 使用 PHPmailer 从网站发送消息时遇到错误

javascript - 如何在从父窗口创建的 iframe 加载处理程序中获取对 iframe 窗口对象的引用

php - 表单和 PHP 在一个文件中

PHP : How to put and pass variable in modal URL

php - 如何查询从varchar类型和数字值中获取最大id?

mysql - 如何优化事件日历的数据模型?

c# - ElasticSearch - 如何从插入查询中获取自动生成的 id