本文整理匯總了PHP中Mysql_num_rows函數的典型用法代碼示例。如果您正苦於以下問題:PHP Mysql_num_rows函數的具體用法?PHP Mysql_num_rows怎麽用?PHP Mysql_num_rows使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Mysql_num_rows函數的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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_query
$sql = "SELECT drugcode FROM drugrx WHERE hn = '".$_SESSION["hn_now"]."' AND drugcode <> 'INJ' ";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);
if($rows > 0){
while(list($codes) = mysql_fetch_row($result)){
array_push($listremedint,$codes);
}
}
$list_session = " '".implode("','",$_SESSION["list_drugcode"])."' ";
$list_session2 = " '".implode("','",$listinteraction)."' ";//listбр╥уХар╗ркА╬╥бЛмвХ╧
$list_session3 = " '".implode("','",$listremedint)."' ";//listбр╥уХар╗р║║рцremed
$sql = "SELECT first_drugcode, between_drugcode, effect, action, follow, onset, violence, referable, status FROM drug_interaction where (first_drugcode = '".$_GET["drugcode"]."' AND between_drugcode in (".$list_session.") ) OR (between_drugcode = '".$_GET["drugcode"]."' AND first_drugcode in (".$list_session.") ) OR (first_drugcode = '".$_GET["drugcode"]."' AND between_drugcode in (".$list_session2.") ) OR (between_drugcode = '".$_GET["drugcode"]."' AND first_drugcode in (".$list_session2.") ) OR (first_drugcode = '".$_GET["drugcode"]."' AND between_drugcode in (".$list_session3.") ) OR (between_drugcode = '".$_GET["drugcode"]."' AND first_drugcode in (".$list_session3.") ) ";
$result = Mysql_Query($sql);
$rows = Mysql_num_rows($result);
if($rows == 0){
echo "0";
//echo "$sql ";
}else{
$arr = Mysql_fetch_assoc($result);
$i=0;
$sql = " Select genname From druglst where drugcode in ('".$arr["first_drugcode"]."','".$arr["between_drugcode"]."') ";
$result = Mysql_Query($sql);
while($arr2 = Mysql_fetch_assoc($result)){
$druglist[$i] = $arr2["genname"];
$i++;
}
if($arr["status"]=="popup"){
echo "1Ю║т╢ Drug Interaction цпкгХр╖бр ".$druglist[0]." ║я╨бр ".$druglist[1]." \n ╪е║цп╥╨ : ".$arr["effect"]." \n ║еД║╥уХЮ║т╢ : ".$arr["action"]." \n ║рц╣т╢╣ра : ".$arr["follow"]." \n onset : ".$arr["onset"]." \n ╓граць╧Ац╖ : ".$arr["violence"]." \n кея║╟р╧ : ".$arr["referable"]." \n й╤р╧п : ".$arr["status"]." \n ╥Хр╧бя╖╣Им╖║рц╗ХрббркцвмДаХ? ";
示例3: urlencode
echo urlencode($_GET["nRow_id"]);
?>
" target="_blank" ><font face='Angsana New'>á¡é䢪×èÍâä</font></A><BR>
<td>
<div id='cut1' style="display:block">
</td>
<td><FONT COLOR="#FF0000"><B>à¤ÂµÑ´ÊµêÍ¡áÅéÇ</B></FONT> </td>
<?php
}
?>
</td>
<td><a target="_blank" href="drxprint_pt.php"><font face='Angsana New'>¾ÔÁ¾ìãºÊÑè§ÂÒ</a></td>
</tr></table>
<?php
$strsql = "select * from accrued where hn = '{$sHn}' and status_pay='n' ";
$strresult = mysql_query($strsql);
$strrow = mysql_num_rows($strresult);
if ($strrow > 0) {
echo "<script>alert('¼Ùé»èÇÂÁÕÂÍ´¤éÒ§ªÓÃÐ ¡ÃسҵԴµèÍÊèǹà¡çºà§Ô¹ÃÒÂä´é') </script>";
//echo "  <b><font style='font-weight:bold'><a target=BLANK href='accrued_list.php?hn=$hnid'>´ÙÂÍ´¤éÒ§ªÓÃÐ</a></b></font>";
}
$today1 = date("Y") + 543 . date("-m-d");
$sql = "Select hn,ptname From dphardep WHERE hn = '" . $sHn . "' AND date LIKE '{$today1}%' and dr_cancle is null ";
$result = Mysql_Query($sql);
if (Mysql_num_rows($result) > 1) {
list($hn, $ptname) = Mysql_fetch_row($result);
echo "<br><br><font face='Angsana New' size='5' color='#FF0066'><center>***¼Ùé»èÇÂÁÕãºÃÒÂÂÒÁÒ¡¡ÇèÒ 1 ãº*** </center></FONT>";
}
include "unconnect.inc";
示例4: 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>
示例5: var_dump
{
echo "<pre>";
var_dump($txt);
echo "</pre>";
}
include "checklogin.php";
$_SESSION['close_popup'] = false;
$sql = "Select a.name From doctor as a INNER JOIN inputm as b ON a.doctorcode = b.codedoctor where idname = '" . $_SESSION["sIdname"] . "' limit 1";
list($doctorname) = Mysql_fetch_row(Mysql_Query($sql));
$thidate = date("d-m-") . (date("Y") + 543);
$sql = "Select vn, hn, ptname, toborow,thidate From opd where thdatehn like '" . $thidate . "%' AND doctor = '" . $doctorname . "' AND dc_diag is NULL Order by vn ASC ";
$result_list_pt = Mysql_Query($sql);
$num_list_pt = Mysql_num_rows($result_list_pt);
$sql = "Select vn, hn, ptname, toborow ,thidate \nFrom opd \nwhere thdatehn like '" . $thidate . "%' \nAND room = 'ËéͧµÃǨâä·ÑèÇä»' \nAND dc_diag is NULL \nOrder by vn ASC ";
$result_list_pt2 = Mysql_Query($sql);
$num_list_pt2 = Mysql_num_rows($result_list_pt2);
?>
<html>
<head>
<title><?php
echo $_SESSION["sOfficer"];
?>
</title>
<style type="text/css">
<!--
body,td,th {
font-family: Angsana New;
font-size: 20px;
}
.tb_head {background-color: #0046D7; color: #FFFFCA; font-weight: bold; text-align:center; }
示例6: if
<td >".$name." ".$sname."</td>
<td >".$dateopd."</td>
<td ><A HREF=\"ward_follow_refer.php?edit_refer=edit&search_id=".$row_id."\">А║ИД╒</A></td>
</tr>";
}
echo "</table>
</td>
</tr>
</table>";
}else if($_GET["edit_refer"] == "edit" && $_GET["search_id"] !=""){
$sql = "Select a.row_id, a.name, a.sname, a.age, a.hn, a.an, a.type_wound, date_format(b.date,'%d-%m-%Y'), date_format(b.date,'%H:%i'), time_format(a.time_refer,'%H:%i'), a.doctor, a.diag, a.exrefer , a.referh, a.problem_refer, a.pttype, a.refercar, a.list_type_patient, a.follow_refer From refer as a INNER JOIN ipcard as b ON a.an=b.an Where a.row_id='".$_GET["search_id"]."' Order by a.row_id DESC limit 1 ";
$result = mysql_query($sql);
if(Mysql_num_rows($result) ==0){
echo "<BR><BR><CENTER>ДаХаукарбЮе╒ AN ╧уИ</CENTER>";
}else{
list($row_id, $name, $sname, $age, $hn, $an, $type_wound, $date, $time_date, $time_refer, $doctor, $diag, $exrefer , $referh, $problem_refer, $pttype, $refercar, $list_type_patient, $follow_refer)=mysql_fetch_row($result);
echo "
<FORM METHOD=POST ACTION=\"\">
<TABLE border='1' bordercolor='#0033FF'><TR>
<TD>
<!-- црбепЮмуб╢╒м╖║рц Refer -->
<TABLE>
<TR>
<TD align=\"center\" bgcolor='#0033FF'><FONT COLOR=\"#FFFFFF\"><B>А║ИД╒╒Имаые црбепЮмуб╢╒м╖║рц Refer</B></FONT></TD>
</TR>
<TR>
示例7: Mysql_Query
echo $month_[$_REQUEST["month"]]," ",$_REQUEST["year"],"<BR>";
$sql_detail = "SELECT hn,an,ptname,age,ptright,bedcode,doctor,bed,diagnos FROM bed WHERE an = '".$_REQUEST["an"]."'";
$result_detail = Mysql_Query($sql_detail);
if(Mysql_num_rows($result_detail) == 0){
$sql = "Select hn,an,ptname,age,ptright,bedcode,doctor,bed,diag From ipcard WHERE an = '".$_REQUEST["an"]."'";
$result_detail = Mysql_Query($sql_detail);
$arr = Mysql_fetch_assoc($result_detail);
}else{
$arr = Mysql_fetch_assoc($result_detail);
}
$sql_react = "Select drugcode, tradname , advreact From drugreact where hn = '".$arr["hn"]."' ";
$result_react = Mysql_Query($sql_react);
$rows_react = Mysql_num_rows($result_react);
if($rows_react> 0){
echo "<FONT COLOR=\"red\">á¾éÂÒ·Ñé§ËÁ´ ".$rows_react." ÃÒ¡ÒÃ<BR>";
while(list($drugcode, $tradname , $advreact) = Mysql_fetch_row($result_react)){
echo "[",$drugcode,"] : ", $tradname , " ( ÍÒ¡ÒÃ : ",$advreact," )<BR>";
}
echo "</FONT>";
}
echo "<CENTER>âç¾ÂÒºÒŤèÒÂÊØÃÈÑ¡´ÔìÁ¹µÃÕ</CENTER>";
echo "<CENTER>ẺºÑ¹·Ö¡¡ÒÃãªéÂÒ/àǪÀѳ±ì¼Ùé»èÇÂã¹</CENTER>";
echo "<CENTER>¡Í§àÀÊѪ¡ÃÃÁàÍ¡ÊÒÃËÁÒÂàÅ¢ FR-PHA-001/11</CENTER>";
echo "<CENTER>
HN<U> ",$arr["hn"]," </U>
AN<U> ",$arr["an"]," </U>
ª×èͼÙé»èÇÂ<U> ",$arr["ptname"]," </U>
示例8: add_borrowAN
function add_borrowAN()
{
$thidate = date("Y") + 543;
$this->borrowAN_year = substr($thidate, 2, 2);
$sql = "Select borrowAN_id From borrowan where AN = '" . $this->AN . "' AND receiver is null Order by borrowAN_id DESC";
$result = mysql_query($sql);
$rows = Mysql_num_rows($result);
if ($rows > 0) {
$result = false;
} else {
$sql = "Select borrowAN_id From borrowan where borrowAN_year = '" . $this->borrowAN_year . "' Order by borrowAN_id DESC";
$result = mysql_query($sql);
if (mysql_num_rows($result) == 0) {
$this->borrowAN_id = 1;
} else {
$arr = Mysql_fetch_assoc($result);
$this->borrowAN_id = $arr["borrowAN_id"] + 1;
}
$sql = "INSERT INTO `borrowan` ( `borrowAN_year` , `borrowAN_id` , `HN` , `AN` , `borrower` , `receiver` , `borrowAN_startdate` , `borrowAN_enddate` ) \n\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t'" . $this->borrowAN_year . "', '" . $this->borrowAN_id . "', '" . $this->HN . "', '" . $this->AN . "', '" . $this->borrower . "', " . $this->receiver . ", '" . $this->borrowAN_startdate . "', " . $this->borrowAN_enddate . "\n\t\t\t\t\t\t);\n\n\t\t\t\t\t";
$result = Mysql_Query($sql);
}
return $result;
}
示例9: mysql_query
mysql_query($SQL, $_SESSION['db']);
$SQL = "delete from concert_musician where concert_ID={$concert_ID}";
mysql_query($SQL, $_SESSION['db']);
}
if (!isset($_GET['startrow']) or !is_numeric($_GET['startrow'])) {
$startrow = 0;
} else {
$startrow = (int) $_GET['startrow'];
}
$SQL = "SELECT * FROM concerts ORDER BY Date LIMIT {$startrow}, 10";
//$retval = mysql_query($SQL, $_SESSION['db']);
$fetch = mysql_query($SQL, $_SESSION['db']) or die(mysql_error());
?>
<?php
$num = Mysql_num_rows($fetch);
if ($num > 0) {
echo "<table class=\"table-bordered table-condensed\">";
echo "<tr><th>Název koncertu</th><th>Datum koncertu</th></tr>";
for ($i = 0; $i < $num; $i++) {
$row = mysql_fetch_row($fetch);
?>
<tr>
<form method="post" action="show_concert.php">
<td><input type="hidden" name="Cname" value="<?php
echo $row[1];
?>
"></input><?php
echo $row[1];
?>
示例10: 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".
示例11: session_start
<?php
session_start();
include "connect.inc";
include "checklogin.php";
$sql = "Select a.name From doctor as a INNER JOIN inputm as b ON a.doctorcode = b.codedoctor where idname = '" . $_SESSION["sIdname"] . "' limit 1";
list($doctorname) = Mysql_fetch_row(Mysql_Query($sql));
$thidate = date("d-m-") . (date("Y") + 543);
$sql = "Select vn, hn, ptname, toborow From opd where thdatehn like '" . $thidate . "%' AND doctor in ('MD020 ˹Öè§Ä·Ñ ÁËÒÂȹѹ·ì','MD030 à¡×éÍ¡ÙÅ ¼ÊÁ·ÃѾÂì','MD043 ÇÕÃÐÂØ·¸ì ǧÈì¨Ñ¹·Ãì') AND dc_diag is NULL Order by vn ASC ";
$result_list_pt = Mysql_Query($sql);
$num_list_pt = Mysql_num_rows($result_list_pt);
?>
<html>
<head>
<title></title>
<style type="text/css">
<!--
body,td,th {
font-family: Angsana New;
font-size: 20px;
}
.tb_head {background-color: #0046D7; color: #FFFFCA; font-weight: bold; text-align:center; }
.tb_detail {background-color: #FFFFC1; }
.tb_detail2 {background-color: #FFFFFF; }
-->
</style>
<SCRIPT LANGUAGE="JavaScript">
window.onload = function(){
示例12: Mysql_Query
$sql = "Select * From trauma_labcare where for_id = '".$_GET["id"]."' AND hn = '".$arr["hn"]."' ";
$result = Mysql_Query($sql);
$total_labcare = Mysql_num_rows($result);
$div_list_labcare = "";
$i=1;
while($arr2 = Mysql_fetch_assoc($result)){
$div_list_labcare .= " ".$i.". Ëѵ¶¡Òà Í×è¹æ : <INPUT TYPE='text' NAME='labcare[]' value='".$arr2["labcare"]."'> ¨Ó¹Ç¹¤ÃÑé§ <INPUT TYPE=\"text\" NAME=\"amount_labcare[]\" size=\"2\" onkeypress=\"check_number();\" value=\"".$arr2["amount"]."\"><BR>";
$i++;
}
$sql = "Select * From trauma_lst_labcare where for_id = '".$_GET["id"]."' AND hn = '".$arr["hn"]."' ";
$result = Mysql_Query($sql);
$total_lst_labcare = Mysql_num_rows($result);
$div_list_lst_labcare = "";
$i=1;
while($arr2 = Mysql_fetch_assoc($result)){
$div_list_lst_labcare .= " ".$i.". Ëѵ¶¡Òà : <SELECT NAME='lst_labcare[]'>";
foreach($list_labcare as $key => $value){
$div_list_lst_labcare .= "<Option value='".$key."' ";
if($key == $arr2["lst_labcare"]) $div_list_lst_labcare .= " Selected ";
$div_list_lst_labcare .= ">".$value."</Option> ";
}
$div_list_lst_labcare .= "</SELECT> ¨Ó¹Ç¹¤ÃÑé§ <INPUT TYPE=\"text\" NAME=\"amount_lst_labcare[]\" size=\"2\" onkeypress=\"check_number();\" value=\"".$arr2["amount"]."\"><BR>";
$i++;
}
示例13: Mysql_fetch_assoc
while($arr2 = Mysql_fetch_assoc($result2)){
$list[$i] = $arr2["code"];
$i++;
}
echo "<A HREF=\"#\" Onclick=\"addsuittolist('".implode("][",$list)."');\">".$arr["detail"]."</A><BR>";
}
}*/
echo "\t</TD>\n</TR>\n</TABLE>\n";
exit;
}
//*****************************áÊ´§µÑǪèÇ Other********************//
if (isset($_GET["action"]) && $_GET["action"] == "other") {
$sql34 = "Select distinct(other) from appoint where other like '%" . $_GET["search1"] . "%' limit 10 ";
$result34 = Mysql_Query($sql34) or die(Mysql_error());
if (Mysql_num_rows($result34) > 0) {
echo "<Div style=\"position: absolute;text-align: center; width:400px; height:430px; overflow:auto; \">";
echo "<table width=\"400\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FF99CC\"><tr align=\"center\" bgcolor=\"#333333\">\n\t\t<td width=\"10\"><strong> </strong></td>\n\t\t<td width=\"200\"><font style=\"color: #FFFFFF;\"><strong>ÃÒ¡ÒÃ</strong></font></td>\n\t\t<td width=\"10\"><strong> <A HREF=\"#\" onclick=\"document.getElementById('list1').innerHTML='';\"><font style=\"color: #FFFF99;\">»Ô´</font></A></strong></td>\n\t\t</tr>";
//$i=1;
while ($se = Mysql_fetch_assoc($result34)) {
echo "<tr>\n\t\t<td valign=\"top\" width=\"10\"></td>\n\t\t<td width=\"200\"><A HREF=\"javascript:void(0);\" Onclick=\"document.getElementById('other').value = '" . $se['other'] . "';document.getElementById('list1').innerHTML ='';\">" . $se['other'] . "</A></td>\n\t\t<td width=\"10\"> </td></tr>";
}
echo "</TABLE></Div>";
}
exit;
}
//************************** áÊ´§ÃÒ¡Òà lab ********************************************************
if (isset($_GET["action"]) && $_GET["action"] == "addtolist") {
$sql = "Select detail, yprice, nprice From labcare where code = '" . $_GET["code"] . "' limit 1; ";
list($detail, $yprice, $nprice) = Mysql_fetch_row(Mysql_Query($sql));
array_push($_SESSION["list_code"], $_GET["code"]);