基于mysql结果突出显示 [英] highlighting based on mysql result
本文介绍了基于mysql结果突出显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello,
the code below is working, but I need to highlight based on result that are
unmatched empno,code & amount in different colors.
This code is for finding unmatched columns from 2 tables [employee & emp_det]
$res = mysql_query("SELECT * FROM employee WHERE NOT EXISTS(SELECT 1 FROM emp_det WHERE empno = emp_det.empno AND code = emp_det.code AND amount = emp_det.amount)");
while($row=mysql_fetch_array($res))
{
echo "<tr>";
echo "<td align="center" width="200">" . $row['emp_no']. "</td>";
echo "<td align="left" width="200">" . $row['name'] . "</td>";
echo "<td align="left" width="200">" . $row['dept'] . "</td>";
echo "<td align="center" width="100">" . $row['code'] . "</td>";
echo "<td align="center" width="100">" . $row['amount'] . "</td>";
echo "</tr>";
}
echo "";
need to highlight unmatched values in the 3 columns
推荐答案
res = mysql_query(SELECT * FROM employee WHERE NOT EXISTS(SELECT 1 FROM emp_det WHERE empno = emp_det.empno AND code = emp_det.code AND amount = emp_det.amount));
while(
res = mysql_query("SELECT * FROM employee WHERE NOT EXISTS(SELECT 1 FROM emp_det WHERE empno = emp_det.empno AND code = emp_det.code AND amount = emp_det.amount)"); while(
row = mysql_fetch_array(
row=mysql_fetch_array(
res))
{
echo < tr > ;
echo< td align = center width = 200 > 。
res)) { echo "<tr>"; echo "<td align="center" width="200">" .
这篇关于基于mysql结果突出显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文