如何在php中使用while循环捕获数据时将第一行设置为粗体

时间:2017-06-10 08:08:58

标签: php

我希望我的第一行只显示大字体而另一行以小字体显示数据(行)...

这是我的代码:

<?php
$tasktable = mysql_query("SELECT * FROM tasks WHERE taskstatus != 'Done' AND assignedto = '". $uname ."'  ORDER BY taskduedate,taskpriority,taskcategory");
    echo "<table border = '0' align='center' style='font-family:Calibri;'>";
        echo "<tr bgcolor='#82CAFF'><td align='center' style='font-size:15px;'><b>Assigned Date</b></td>
        <td align='center' style='font-size:15px;' ><b>Task Time</b></td>
        <td align='center' style='font-size:15px;' ><b>Task Name</b></td>
        <td align='center' style='font-size:15px;' ><b>Category</b></td>
        <td align='center' style='font-size:15px;' ><b>Priority</b></td>
        <td align='center' style='font-size:15px;' ><b>Estimated Time</b></td>
        <td align='center' style='font-size:15px;' ><b>Status</b></td>
        <td align='center' style='font-size:15px;' ><b>Update</b></td></tr>";
       $i=0;
       while($task = MYSQL_FETCH_OBJECT($tasktable)){ 
         if($i==0) { 
         $i=1;
         echo 'active';} 
         echo "<tr bgcolor='#F0FFFF' font-family:Calibri>";
            echo "<td style='font-family:Calibri; font-size:14px;'>";   
            $taskduedate =  $task ['taskduedate'];
            echo $taskduedate;
            echo "</td>";
            echo "<td style='font-family:Calibri; font-size:14px;'>";   
            $taskduetime =  $task ['taskduetime'];
            echo $taskduetime;
            echo "</td>";
            echo "<td style='font-family:Calibri; font-size:14px;'>";
            $taskname =  $task ['taskname'];
            echo $taskname;
            echo "</td><td style='font-family:Calibri; font-size:14px;'>";
            $taskcategory =  $task ['taskcategory'];
            echo $taskcategory;
            echo "</td>";
            echo "<td style='font-family:Calibri; font-size:14px;'>";   
            $taskpriority =  $task ['taskpriority'];
            echo $taskpriority;
            echo "<td style='font-family:Calibri; font-size:14px;'>";   
            $estimatedtime =  $task ['estimatedtime'];
            echo $estimatedtime;
            echo "</td>";   
            echo "<td style='font-family:Calibri; font-size:14px;'>";   
            $taskstatus =  $task ['taskstatus'];
            echo $taskstatus;
            echo "</td>";
            echo "<td style='font-family:Calibri; font-size:11px;'><a href='#'>";   
            echo "Update";
            echo "</a></td>";
           $i++;
       }
        echo "</tr>";
        echo "</table>";
?>

但它不起作用。我不明白。所以,请帮帮我! 谢谢。

1 个答案:

答案 0 :(得分:0)

#include <stdio.h>    
#include <stdlib.h>    
#include <ctype.h>    
#include <string.h>    

 /* includes for WebSphere MQ */    
#include <cmqc.h>                  /* For regular MQI definitions   */    
#include <cmqxc.h>                 /* For MQCD definition           */