本文整理匯總了PHP中Mysql_Query函數的典型用法代碼示例。如果您正苦於以下問題:PHP Mysql_Query函數的具體用法?PHP Mysql_Query怎麽用?PHP Mysql_Query使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Mysql_Query函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: input_hn
function input_hn($hn){
include("connect.inc");
$this->hn = $hn;
$this->Thaidate = date("d-m-").(date("Y")+543);
$sql = "Select vn, kew, toborow From opday where thdatehn = '".$this->Thaidate.$this->hn."' Order by row_id DESC limit 0,1";
$result = Mysql_Query($sql);
list($this->vn, $this->kew, $this->toborow) = Mysql_fetch_row($result);
$sql = "Select yot, name, surname, idcard, ptright, dbirth, idguard, inrxform, note From opcard where hn = '".$this->hn."' limit 0,1";
list($yot, $name, $surname,$this->idcard,$this->ptright, $dbirth, $this->idguard, $this->inrxform, $this->note) = Mysql_fetch_row(Mysql_Query($sql));
$this->ptname = $yot." ".$name." ".$surname;
$this->age = $this->calcage($dbirth);
if( $this->inrxform != ""){
if($this->inrxform == "¼Ùé»èÇ¡ÅØèÁàÊÕ觵éͧä´éÃѺ¡ÒéմÇѤ«Õ¹»éͧ¡Ñ¹âää¢éËÇÑ´ãËè(¿ÃÕ)")
$this->inrxform .= "<BR>Influza Vaccine 0.5 ml. IM";
$this->inrxform = "<table width='210' border='0'><TR><TD align='center'>".$this->inrxform;
$this->inrxform .= "<TD></TR></Table>";
}
$sql = "Select tradname, advreact From drugreact where hn = '".$this->hn."' ";
$result = Mysql_Query($sql);
if(Mysql_num_rows($result) > 0){
$this->drugreact = "<Table width='210' border='0'><TR><TD colspan='2'><U><B>á¾éÂÒ</B></U></TD></TR>";
while($arr = Mysql_fetch_assoc($result)){
$this->drugreact .= "<TR><TD>ÂÒ:".$arr["tradname"]."<BR>ÍÒ¡ÒÃ:".$arr["advreact"]."</TD></TR>";
}
$this->drugreact .= "</Table>";
}
include("unconnect.inc");
}
示例2: Mysql_fetch_row
}else{
if(($drugcode2[0] == "0" || $drugcode2[0] == "2") && !(ord($drugcode2[1]) >= 48 && ord($drugcode2[1]) <= 57 )){
echo "<td align=\"center\"><INPUT TYPE=\"text\" NAME=\"stiker[]\" value=\"".$_SESSION["list_druglst"]["amount"][$j]."\" size='2'></td>";
}else{
echo "<td align=\"center\"><INPUT TYPE=\"text\" NAME=\"stiker[]\" value=\"0\" size='2'></td>";
}
}
echo "<INPUT TYPE=\"hidden\" NAME=\"Drugcode[]\" value=\"".htmlspecialchars($_SESSION["list_druglst"]["drugcode"][$j])."\">";
echo "<INPUT TYPE=\"hidden\" NAME=\"Tradname[]\" value=\"".htmlspecialchars($_SESSION["list_druglst"]["tradname"][$j])."\">";
echo "<INPUT TYPE=\"hidden\" NAME=\"Slipcode[]\" value=\"".htmlspecialchars($_SESSION["list_druglst"]["slcode"][$j])."\">";
$sql = "Select salepri, part, unit,freepri From druglst where drugcode = '".$_SESSION["list_druglst"]["drugcode"][$j]."' limit 0,1 ";
list($Salepri,$Part,$Unit, $freepri) = Mysql_fetch_row(Mysql_Query($sql));
echo "<INPUT TYPE=\"hidden\" NAME=\"Salepri[]\" value=\"",htmlspecialchars($Salepri),"\">";
echo "<INPUT TYPE=\"hidden\" NAME=\"Freepri[]\" value=\"",htmlspecialchars($freepri),"\">";
echo "<INPUT TYPE=\"hidden\" NAME=\"Part[]\" value=\"",htmlspecialchars($Part),"\">";
echo "<INPUT TYPE=\"hidden\" NAME=\"Unit[]\" value=\"",htmlspecialchars($Unit),"\">";
echo "<INPUT TYPE=\"hidden\" NAME=\"Statcon[]\" value=\"",htmlspecialchars($_SESSION["list_druglst"]["statcon"][$j]),"\">";
echo "</TR>";
}
?>
</TABLE>
</TD>
</TR>
</TABLE>
示例3: AND
$color = "66CDAA";
}
}
if (!empty($idcard)) {
$sql = "Select id From ssodata where id LIKE '{$idcard}%' limit 1 ";
if (Mysql_num_rows(Mysql_Query($sql)) > 0) {
echo "���������Է�Ի�Сѹ�ѧ��";
} else {
echo "";
}
} else {
echo "������������Ţ��Шӵ�ǻ�ЪҪ�";
}
if (!empty($hn)) {
$sql = "Select hn, status From cscddata where hn = '{$hn}' AND ( status like '%U%' OR status = '\r' OR status like '%V%') limit 1 ";
if (Mysql_num_rows(Mysql_Query($sql)) > 0) {
echo "���������Է�Ԩ��µç";
} else {
echo "";
}
} else {
echo "����������� HN";
}
print " <tr>\n" . " <td BGCOLOR=" . $color . "><a target=_BLANK href=\"opedit.php? cIdcard={$idcard}&cHn={$hn} & cName={$name} &cSurname={$surname}\">{$idcard}</a></td>\n" . " <td BGCOLOR=" . $color . ">{$hn}</td>\n" . " <td BGCOLOR=" . $color . ">{$yot}</td>\n" . " <td BGCOLOR=" . $color . ">{$name}</td>\n" . " <td BGCOLOR=" . $color . ">{$surname}</td>\n" . " <td BGCOLOR=" . $color . ">{$ptright}</td>\n" . " <td BGCOLOR=" . $color . "><a target= _BLANK href=\"hndaycheck.php?hn={$hn}\">�� þ.</td>\n" . " <td BGCOLOR=" . $color . "><a target= _BLANK href=\"appdaycheck.php?hn={$hn}\">��Ǩ�Ѵ</td>\n" . " <td BGCOLOR=" . $color . "><a target= _BLANK href=\"ancheck.php?hn={$hn}\">��Ǩ�</td>\n" . " </tr>\n";
}
include "unconnect.inc";
}
?>
</table>
<FONT SIZE="2" COLOR="#990000">***��Ժ��***</FONT> <BR>
<FONT SIZE="" COLOR="66CDAA">������ ��� �ѧ�����ӡ�õ�Ǩ�Է�ԡ���ѡ��</FONT><BR>
示例4: date
<th bgcolor=6495ED class="font1">ÊèǹÊÙ§</th>
<th bgcolor=6495ED class="font1">BMI</th>
</tr>
<?php
$ckdate = date("Y") + 543 . date("-m-d");
$datenow = date("Y") + 543 . date("-m-d H:i:s");
$query = "SELECT an,bed,ptname,diagnos,diag1,food,bedcode,age,hn,ptright,bedname,bedpri\n FROM bed WHERE bedcode LIKE '{$lbedcode}%' ORDER BY bed ASC ";
$result = mysql_query($query) or die("Query failed");
while (list($an, $bed, $ptname, $diagnos, $diag1, $food, $bedcode, $age, $hn, $ptright, $bedname, $bedpri) = mysql_fetch_row($result)) {
if ($diag1 == "âä»ÃШӵÑÇ") {
$diag1_value = "";
} else {
$diag1_value = $diag1;
}
$sql = "SELECT thidate,weight,height FROM opd WHERE hn ='{$hn}' order by thidate DESC limit 1 ";
list($thidate, $weight, $height) = mysql_fetch_row(Mysql_Query($sql));
$bmi = '';
if ($height != "" && $height > 0 && $weight != "" && $weight > 0) {
$ht = $height / 100;
$bmi = number_format($weight / ($ht * $ht), 2);
}
print " <tr>\n" . " <td BGCOLOR=66FFCC>{$bed}</td>\n" . " <td BGCOLOR=66FFCC>{$hn}</td>\n" . " <td BGCOLOR=66FFCC>{$ptname}</td>\n" . " <td BGCOLOR=66FFCC>{$diagnos}</td>\n" . " <td BGCOLOR=#00FF66>{$diag1_value}</td>\n" . " <td BGCOLOR=#FFCC66><a target=_BLANK href=\"food_ex.php?cAn={$an}\">{$food}</a></td>\n" . " <td BGCOLOR=66FFCC>{$age}</td>\n" . " <td BGCOLOR=66FFCC>{$weight}</td>\n" . " <td BGCOLOR=66FFCC>{$height}</td>\n" . " <td BGCOLOR=66FFCC>{$bmi}</td>\n" . " </tr>\n";
/////////////////////////// FOOD //////////////////////////////
if ($an != '') {
$select = "select * from food where regisdate like '{$ckdate}%' and an='{$an}' and typefood='" . $_POST['menu'] . "' ";
// echo $select."<br>";
$strresult = mysql_query($select) or die("Query failed food");
$rows = mysql_num_rows($strresult);
$arr = mysql_fetch_array($strresult);
if ($rows) {
$update = "UPDATE `food` SET \n`an` = '{$an}',\n`ptname` = '{$ptname}',\n`ptright` = '{$ptright}',\n`bedcode` = '{$bedcode}',\n`bedpri` = '{$bedpri}',\n`food` = '{$food}',\n`typefood` = '" . $_POST['menu'] . "',\n`bedname` = '{$bedname}' ,\nofficer='" . $sOfficer . "' WHERE row_id='" . $arr['row_id'] . "' ";
示例5: array
$xx = array("[idno]", "[Thidate]");
$yy = array($runno, $_POST["list_date"][$i]." 00:00:00");
$sql_dphardep2 = str_replace($xx,$yy,$sql_dphardep);
if($rows_drugrx > 0){
$result = Mysql_Query($sql_dphardep2) or die(mysql_error());
$idno = mysql_insert_id();
$yy = array($idno, $_POST["list_date"][$i]." 00:00:00");
$sql_ddrugrx2 = str_replace($xx,$yy,$sql_ddrugrx);
$k=$i+2;
$qq = array("[INJNO]");
$zz = array("������ $k");
$sql_ddrugrx2 = str_replace($qq,$zz,$sql_ddrugrx2);
$result = Mysql_Query($sql_ddrugrx2) or die(mysql_error());
}
}
}
?>
<HTML>
<HEAD>
<TITLE> �Ѵ�մ�� </TITLE>
<style type="text/css">
a:link {color:#FF0000; text-decoration:underline;}
示例6: mysql_query
$result = mysql_query($sqltel);
$sql = "INSERT INTO appoint(date,officer,hn,ptname,age,doctor,appdate,apptime,room,\ndetail,detail2,advice,patho,xray,other,depcode,labextra)\n\n\tVALUES('{$Thidate}','{$sOfficer}','{$cHn}','{$cPtname}','{$cAge}','{$cdoctor}','{$appd}','{$capptime}',\n\n\t'{$room}','{$detail}','" . jschars($detail2) . "','{$advice}','{$pathoall}','{$xrayall}','" . jschars($other) . "','{$depcode}','" . jschars($labm) . "');";
$result = mysql_query($sql);
$idno = mysql_insert_id();
$count = count($_SESSION["list_code"]);
if ($count > 0) {
$sql = "INSERT INTO `appoint_lab` ( `id` , `code` ) VALUES ";
$list = array();
for ($n = 0; $n < $count; $n++) {
if (!empty($_SESSION["list_code"][$n])) {
$q = "('" . $idno . "', '" . $_SESSION["list_code"][$n] . "') ";
array_push($list, $q);
}
}
$sql .= implode(", ", $list);
$result = Mysql_Query($sql) or die("Error appoint_lab " . Mysql_Error());
$patho = implode(", ", $_SESSION["list_code"]);
}
$pathoall = $patho . ' ' . $patho2;
// echo mysql_errno() . ": " . mysql_error(). "\n";
// echo "<br>";
//�����㺹Ѵ
////////////////////////
$exm = explode(" ", $appd);
$d1 = $exm[0];
$m1 = trim($exm[1]);
$y1 = $exm[2] - 543;
$arr1 = array("���Ҥ�" => "01", "����Ҿѹ��" => "02", "�չҤ�" => "03", "����¹" => "04", "����Ҥ�" => "05", "�Զع�¹" => "06", "�á�Ҥ�" => "07", "�ԧ�Ҥ�" => "08", "�ѹ��¹" => "09", "���Ҥ�" => "10", "��Ȩԡ�¹" => "11", "�ѹ�Ҥ�" => "12");
$appday = $y1 . '-' . $arr1[$m1] . '-' . $d1;
$DayOfWeek = date("w", strtotime($appday));
// echo $DayOfWeek;
示例7: mysql_query
/* ���������ǹ������ ipdibill.php��ͷ������ �������������Ţ�ѭ��
$cAccno++;
$query ="UPDATE bed SET price='$Netpri',
paid='$Netpaid',
debt='$debt',
caldate='$Thidate',
accno='$cAccno'
WHERE an='$cAn' ";
$result = mysql_query($query) or die("Query failed bed");
echo mysql_errno() . ": " . mysql_error(). "\n";
echo "<br>";
*/
$sql = "Select sum(price),status FROM ipacc WHERE an = '$cAn' and status='��˹���' group by status ";
$result2 = Mysql_Query($sql) or die(mysql_error());
list($pricedc,$status) = Mysql_fetch_row($result2);
include("unconnect.inc");
//����ѡ�Ҿ�Һ�� �ѡ���������� �����͡�������ǹ����ҧ����
$BFY = array_sum($aBBFY);
$BFN = array_sum($aBBFN);
//�ҷ����� þ. ��¡�������� �ѡ�Թ�����������͡
//�ҷ����� þ.��ѹ��Ѻ��ҹ
$Essd1 =array_sum($aBEssd1); //����Թ�����㹺ѭ������ѡ��觪ҵ�
$Nessdy1=array_sum($aBNessdy1); //����Թ����ҹ͡�ѭ������ѡ��觪ҵ� �ԡ��
$DDLDDY1 =$Essd1+$Nessdy1; //3.������������÷ҧ������ʹ(�ԡ��)
$Nessdn1=array_sum($aBNessdn1); //����Թ����ҹ͡�ѭ������ѡ��觪ҵ� �ԡ����
$Essd =array_sum($aBEssd); //����Թ�����㹺ѭ������ѡ��觪ҵ�
$Nessdy=array_sum($aBNessdy); //����Թ����ҹ͡�ѭ������ѡ��觪ҵ� �ԡ��
示例8: left
$rows1=mysql_num_rows($result1);
if($rows1){
echo "<font color='#FF0000'>«éÓ</font>";
}
// µÃǨÊͺáÅÐà»ÅÕè¹ HN AN µÍ¹¢Öé¹»ÕãËÁè
$sql = "Select left(prefix,2) From runno where title = 'HN' ";
list($title_hn) = Mysql_fetch_row(Mysql_Query($sql));
$year_now = substr(date("Y")+543,2);
if($title_hn != $year_now){
$sql = "Update runno set prefix = '".$year_now."-', runno = 0 where title = 'HN' limit 1;";
$result = mysql_Query($sql);
}
$sql = "Select left(prefix,2) From runno where title = 'AN' ";
list($title_an) = Mysql_fetch_row(Mysql_Query($sql));
$year_now = substr(date("Y")+543,2);
if($title_an != $year_now){
$sql = "Update runno set prefix = '".$year_now."/', runno = 0 where title = 'AN' limit 1;";
$result = mysql_Query($sql);
}
// END
?>
</table>
<FONT SIZE="2" COLOR="#990000">***¤Ó͸ԺÒÂ***</FONT> <BR>
<FONT SIZE="" COLOR="66CDAA">ÊÕà¢ÕÂÇ ¤×Í ÂѧäÁèä´é·Ó¡ÒõÃǨÊÔ·¸Ô¡ÒÃÃÑ¡ÉÒ</FONT><BR>
<FONT SIZE="" COLOR="#CCFF00">ÊÕà¢ÕÂÇÍè͹ ¤×Í µÃǨÊͺáÅéÇ ÁÕÊÔ·¸Ô»ÃСѹÊѧ¤Á</FONT><BR>
<FONT SIZE="" COLOR="#99CC00">ÊÕà¢ÕÂÇÍè͹ ¤×Í µÃǨÊͺáÅéÇ ÁÕÊÔ·¸Ô¨èÒµç</FONT><BR>
<FONT SIZE="" COLOR="#FF0033">ÊÕá´§ ¤×Í äÁèÁÕÊÔ·¸Ô</FONT><BR>
示例9: list
$sAn=$cAn;
print "AN $sAn<br>";
}
print "$sPtname<br>";
print "����: $sAge (�ѹ�Դ: $cAge)<br>";
if (!empty($sPtright)){
print "�Է�ԡ���ѡ��: $sPtright<br>";
}
print "�������:$cAddress $cMuang<br>";
print "ᾷ��: $cDoctor<br>";
print "��õ�Ǩ: $cDetail<br>";
print "�ѹ����Ǩ: $sDate<br>";
print "��ҹ��:-<br>";
}
else {
echo "��辺 HN : $hn ";
}
list($report) = Mysql_fetch_row(Mysql_Query("Select report From patdata where row_id = '".$_GET["nRow_id"]."' "));
?>
<form method="POST" action="xrprn.php">
<p><textarea rows="13" name="report" cols="105"><?php echo $report;?></textarea></p>
<p>
<input type="submit" value=" บันทึก " name="B1">
<input type="reset" value=" ลบทิ้ง " name="B2"></p>
</form>
<?php include("unconnect.inc"); ?>
示例10: delete_borrowAN
function delete_borrowAN($id = "")
{
$list = explode("-", $id);
$sql = "Delete From borrowan where borrowAN_year = '" . $list[0] . "' AND borrowAN_id = '" . $list[1] . "' ";
$result = Mysql_Query($sql);
}
示例11: AND
<TD bgcolor="6495ED">AN</TD>
<TD bgcolor="6495ED">ª×èÍ-Ê¡ØÅ</TD>
<TD bgcolor="6495ED">ÊÔ·¸Ôì</TD>
<TD bgcolor="6495ED"><font size='1'>¨Ó¹Ç¹à§Ô¹</TD>
<TD>Êèǹà¡Ô¹</TD>
<TD bgcolor="6495ED">á¼¹¡</TD>
<TD bgcolor="6495ED">à¨éÒ˹éÒ·Õè</TD>
<TD bgcolor="6495ED"><font size='1'>ÍÍ¡OPCARD</TD>
<TD bgcolor="6495ED"><font size='2'>¹Ñ´ÁÒà¾×èÍ</font></TD>
</TR>
<?php
$sql = "Select tvn, hn, ptname, ptright, price,an,date,depart,idname,sumnprice From depart where date like '{$yr}-{$m}-{$d}%' AND (cashok = '' OR cashok is Null ) AND an = '' AND `status` = 'Y' AND price > 0 ORDER BY ptright,date ";
$result = Mysql_Query($sql);
while ($arr = Mysql_fetch_assoc($result)) {
$dapp = "select * from appoint where hn='" . $arr["hn"] . "' and appdate = '" . $d . " " . $mon[$m + 0] . " " . $yr . "' ";
$result2 = Mysql_Query($dapp);
$arr2 = Mysql_fetch_assoc($result2);
$datearr = explode(" ", $arr["date"]);
$datearr2 = explode(":", $datearr[1]);
$times = $datearr2[0] . "." . $datearr2[1];
$more = 24 - $times + $nows + (1 - 2) * 24;
if ($arr["price"] <= '0') {
$color = "#CC3366";
} else {
$color = "66CDAA";
}
if ($more >= 2) {
if ($arr["depart"] == "HEMO") {
$color = "#FFFF66";
} else {
$color = "#FFCACA";
示例12: include
</tr>
</table>
</form>
</div>
<?
include("connect.inc");
if($_POST['y_start']!=''){
$date1=($_POST['y_start']);
}else{
$date1=(date("Y")+543);
}
$sqlncr= "CREATE TEMPORARY TABLE ncr SELECT * FROM ncr2556 WHERE nonconf_date like '".$date1."%' and until ='".$_SESSION["Codencr"]."'";
$result = Mysql_Query($sqlncr) or die(mysql_error());
//$arr=array("risk1","risk2","risk3","risk4","risk5","risk6","risk7","risk8","risk9");
?>
<h1 align="center" class="forntsarabun">ÃÒ§ҹÊÃØ»ÍغѵԡÒÃ³ì »ÃÐ¨Ó»Õ <?=$date1;?> á¼¹¡ <strong><?=$_SESSION["Untilncr"]?></h1>
<table border="1" cellspacing="0" cellpadding="3" bordercolor="#000000" style="border-collapse:collapse">
<tr>
<td rowspan="2" align="center" bgcolor="#00CCFF" class="forntsarabun"><p>à´×͹</p></td>
<td colspan="10" align="center" bgcolor="#00CCFF" class="forntsarabun">ÃдѺ¤ÇÒÁÃعáç·Ò§¤ÅÔ¹Ô¡</td>
<td colspan="9" align="center" bgcolor="#00CCFF" class="forntsarabun">à˵ءÒóì</td>
<td colspan="10" align="center" bgcolor="#00CCFF" class="forntsarabun">ª¹Ô´¢Í§¤ÇÒÁàÊÕè§</td>
示例13: strtotime
$datenow=date("Y-m-d H:i:s"); //«—єє’й
$sallstart = strtotime($datenow)-strtotime($chgdatesall);
//echo $s."<br>";
$dallstart = intval($sallstart/86400); //day
$sallstart -= $dallstart*86400;
$hallstart = intval($sallstart/3600); //hour
//echo "®”є«є«—є $d «—є $h ™—и«вЅІ ";
$daysallstart= $dallstart;
$query5 = "update bed SET days ='$daysallstart' where bedcode = '$bedcode'";
$result5 = mysql_query($query5) or die("Query failed,cannot update beddays");
$query3 = "Select my_food,doctor,diag,dcdate From ipcard where an = '$an' limit 1";
$result3 = Mysql_Query($query3) or die(mysql_error());
list($myfood,$doctor,$diag,$dcdate) = Mysql_fetch_row($result3);
if($dcdate=="0000-00-00 00:00:00"){
if($days>0){
$oBedcode1=substr($bedcode,0,2);
if($oBedcode1 != '44'){
if($cBedpri>$myfood){
$cNBedpri=$cBedpri-$myfood;
$cYBedpri=$cBedpri-$cNBedpri;
}
else {
$cNBedpri=0;
$cYBedpri=$cBedpri;
}
示例14: isset
}elseif($result && isset($_POST["submit2"])){
if($_POST["drugreact"] == 0){
$_POST["congenital_disease"] .=" , ¼Ùé»èÇÂäÁèá¾éÂÒ";
}else{
$i=0;
$list = array();
$sql = "Select tradname From drugreact where hn = '".$_POST["hn"]."' ";
$result = Mysql_Query($sql);
while($arr = Mysql_fetch_assoc($result)){
array_push($list ,$arr["tradname"]);
}
$list_drug = implode(", ",$list);
$_POST["congenital_disease"] .= " , á¾éÂÒ: ".$list_drug;
}
$detail = "select * from condxofyear_emp where thdatevn = '".$date_vn."' order by row_id desc";
$result = Mysql_Query($detail);
$arrs = Mysql_fetch_assoc($result);
?>
<table cellpadding="0" cellspacing="0" border="0" style="font-family:'MS Sans Serif'; font-size:12px">
<tr>
<td>¼Å¡ÒõÃǨÊØ¢ÀÒ¾»ÃШӻÕ</td>
</tr>
<tr>
<td>ª×èÍ : <?php echo $arrs["ptname"];?> HN :<?php echo $arrs["hn"];?></td>
</tr>
<tr>
<td>Çѹ·ÕèµÃǨ : <?php echo $thidate_now;?></td>
</tr>
<tr>
<td>¼Å¡ÒõÃÇ?: <?php echo $arrs["summary"]." ".$arrs["diag"];?></td>
示例15: AND
}
}
$x++;
}
//include("unconnect.inc");
print "<font face='Angsana New'><br>¨Ó¹Ç¹·Ñé§ÊÔé¹ $x ÃÒ¡Òà ´Ñ§¹Õé<br>";
// $x++;
$num=1;
for ($n=$x; $n>=1; $n--){
$time=substr($aDate[$n],11,5);
$time2=substr($atxDate[$n],11,5);
$Nquery = "Select hn, status From cscddata where hn = '$aHn[$n]' AND ( status like '%U%' OR status = '\r' OR status like '%V%') limit 1 ";
if(Mysql_num_rows(Mysql_Query($Nquery)) > 0){
if($aPaidcscd[$n]>0){
$color="#F5DEB3";
}else{
$color="#FF0000";
}
}else{
$color="#FF0000";
}
print("<tr>\n".
"<td bgcolor=$color><font face='Angsana New'>$num</td>\n".
"<td bgcolor=$color><font face='Angsana New'>$aDate[$n]</td>\n".
"<td bgcolor=$color><font face='Angsana New'>$atxDate[$n]</td>\n".
"<td bgcolor=$color><font face='Angsana New'>$aHn[$n]</td>\n".
"<td bgcolor=$color><font face='Angsana New'>$aAn[$n]</td>\n".