|
 |
|
สอบถามเรื่องการรวมตาราง โดยการใช้คำสั่ง mysqli_num_rows นับแถวเพื่อรวมตาราง |
|
 |
|
|
 |
 |
|
ผมขี้เกียจ optimize นะ :(
Code (PHP)
<?php
$data = array();
$i = -1; $dup = array();
while($row = mysqli_fetch_array($result)){
$curr = array($row['datein'], $row['DocName'], $row['DocSur']);
if($dup !== $curr){
$i++;
$dup = $curr;
}
$data[$i][] = $row;
}
foreach ($data as $i => $rows) { //doctor group
$cnt = count($rows)
foreach ($rows as $j => $row) { //treat data
?>
<tr>
<?php if($ตัวแปรไรหว่า==0) : ?> <td align="center" width="700" rowspan="<?phpให้เดาว่าต้องทำยังไง?>"><?php echo $row['datein']; ?> </td>
<td align="center" width="1000" rowspan="<?phpให้เดาว่าต้องทำยังไง?>"><?php echo $row['DocName']; ?> <?php echo $row['DocSur']; ?></td>
<?php endif; ?>
<td align="center" width="1000"><?php echo $row['symtom']; ?> </td>
<td align="center" width="1000"><?php echo $row['med']; ?> </td>
<td align="center" width="1000"><?php echo $row['med_prop']; ?> </td>
<td align="center" width="1000"><?php echo $row['med_use']; ?> </td>
<td align="center" width="1000"><?php echo $row['med_amount']; ?> </td>
</tr>
<?php
} //treat data
} //doctor group
?>
|
 |
 |
 |
 |
Date :
2014-03-19 10:04:35 |
By :
itpcc |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|