当前位置: 首页>>代码示例>>PHP>>正文


PHP mysqlnumrows函数代码示例

本文整理汇总了PHP中mysqlnumrows函数的典型用法代码示例。如果您正苦于以下问题:PHP mysqlnumrows函数的具体用法?PHP mysqlnumrows怎么用?PHP mysqlnumrows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mysqlnumrows函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMailMessage

/**
* function to get the status of the invite sent to the user
* @param: $contact
*/
function getMailMessage($name) {
	$query=0;
	$query=mysqlquery("select * from vl_emails_outgoing where lower(name)='".strtolower($name)."'");
	if(mysqlnumrows($query)) {
		return mysqlresult($query,0,'description');
	}
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:11,代码来源:functions.mailmessages.php

示例2: getSubordinateOperationsStaff

/**
* OPERATIONS STAFF FUNCTIONS
*/

function getSubordinateOperationsStaff($supervisor) {
	$query=0;
	$query=mysqlquery("select id from vl_users where reportsTo='$supervisor'");
	if(mysqlnumrows($query)) {
		$staff=array();
		while($q=mysqlfetcharray($query)) {
			$staff[]=$q["id"];
		}
		return $staff;
	}
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:15,代码来源:functions.staff.php

示例3: resetPassword

/**
* function to reset a user's password
* @param: $email
*/
function resetPassword($email) {
	global $datetime,$borrowercentralCuser,$home_domain;

	$query=0;
	$query=mysqlquery("select * from vl_users where email='$email'");
	if(mysqlnumrows($query)) {	
		//reset the password and mail the user
		$newPassword=0;
		$newPassword=generatePassword();
		//now reset the password		
		mysqlquery("update vl_users set 
					xp='".borrowercentralcSimpleEncrypt($newPassword)."',
					password='".borrowercentralcRencrypt($newPassword)."' 
					where email='$email'");
					
		//inform the user by email
		//subject
		$subject=0;
		$subject="Password Reset";
	
		//variables
		$password=0;
		$password=$newPassword;
				
		//the message
		$message=0;
		$message="
		Your password has been reset. 
		
		Your new password is: $password 
		
		To preserve your privacy, we recommend that you login and change your password. 
		
		Kind regards, 
		System Team";

		//mail the user
		sendPlainEmail($email,$subject,$message);
	}
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:44,代码来源:functions.email.php

示例4:

                              <td style="padding:0px 0px 0px 5px"><input type="text" name="suspectedTreatmentFailureValue" id="suspectedTreatmentFailureValue" value="<?php 
echo $suspectedTreatmentFailureValue;
?>
" class="search_pre" size="7" maxlength="10" /></td>
                              <td align="right">Sample&nbsp;Type:</td>
                              <td style="padding:0px 0px 0px 5px">
								<select name="suspectedTreatmentFailureSampleTypeID" id="suspectedTreatmentFailureSampleTypeID" class="search">
                                <?
								$query=0;
								$query=mysqlquery("select * from vl_appendix_sampletype order by position");
								if($suspectedTreatmentFailureSampleTypeID) {
									echo "<option value=\"$suspectedTreatmentFailureSampleTypeID\" selected=\"selected\">".getDetailedTableInfo2("vl_appendix_sampletype","id='$suspectedTreatmentFailureSampleTypeID' limit 1","appendix")."</option>";
								} else {
									echo "<option value=\"\" selected=\"selected\">Select Sample Type</option>";
								}
								if(mysqlnumrows($query)) {
									while($q=mysqlfetcharray($query)) {
										echo "<option value=\"$q[id]\">$q[appendix]</option>";
									}
								}
								?>
                                </select>
                              </td>
                            </tr>
						</table>
                        </div>
                </fieldset>
              </td>
            </tr>
            <? //if(!getDetailedTableInfo2("vl_samples_verify","sampleID='$modify'","outcome")) { ?>
            <tr>
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.samples.modify.deprecated.php

示例5: mysqlnumrows

							<tr>
								<td class="<?php 
echo $count < mysqlnumrows($query) ? "vl_tdstandard" : "vl_tdnoborder";
?>
">
									<div><?php 
echo $q["logDetails"];
?>
</div>
                                    <div class="vls_grey" style="padding:5px 0px 0px 0px"><strong>Warning Type:</strong> <?php 
echo $warningType;
?>
</div>
                                </td>
								<td class="<?php 
echo $count < mysqlnumrows($query) ? "vl_tdstandard" : "vl_tdnoborder";
?>
"><?php 
echo getFormattedTimeLessS($q["created"]);
?>
</td>
							</tr>
							<?
						}
					}
					?>
 	               </table>
				  </div>
              </td>
            </tr>
    <tr>
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.statistics.warnings.details.php

示例6:

              <? } ?>
              <input name="act" type="hidden" id="act" value="asampletype">
              <input name="option" type="hidden" id="option" value="<?php 
echo $task;
?>
">
              </td>
            </tr>
          </table>
        </form>

		<?
        $query=0;
        $query=mysqlquery("select * from vl_appendix_sampletype order by position");
		$num=0;
		$num=mysqlnumrows($query);
        if($num) {
        ?>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
            <tr>
                <td style="padding:5px 0px" align="center">
                	<div style="height: 200px; border: 1px solid #ccccff; overflow: auto">
					<table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
                        <tr>
                          <td class="vl_tdsub" width="1%"><strong>#</strong></td>
                          <td class="vl_tdsub" width="60%"><strong>Appendix</strong></td>
                          <td class="vl_tdsub" width="10%"><strong>Samples</strong></td>
                          <td class="vl_tdsub" width="29%">&nbsp;</td>
                        </tr>
                    	<?
                        $count=0;
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.appendix.sampletype.php

示例7: fixDuplicateSampleIDs

/**
* function to fix repeated samples in the VL database
*/
function fixDuplicateSampleIDs() {
	global $datetime,$trailSessionUser;
	//get any duplicate sample IDs
	$query=0;
	$query=mysqlquery("select vlSampleID,count(id) num from vl_samples group by vlSampleID having num>1 order by num desc");
	if(mysqlnumrows($query)) {
		while($q=mysqlfetcharray($query)) {
			//query where vlSampleID=$q[vlSampleID]
			$queryS=0;
			$queryS=mysqlquery("select * from vl_samples where vlSampleID='$q[vlSampleID]' order by created");
			$count=0;
			while($qS=mysqlfetcharray($queryS)) {
				$count+=1;
				//only change the 2nd vlSampleID onwards
				if($count>1) {
					$vlSampleArray=0;
					$vlSampleArray=explode("/",trim($q["vlSampleID"]));
					
					$sampleLength1=0;
					$sampleLength1=strlen($vlSampleArray[0]);
					$sampleLength2=0;
					$sampleLength2=strlen(($vlSampleArray[0]/1)+($count-1));
					$sampleLengthFinal=0;
					$sampleLengthFinal=abs($sampleLength1-$sampleLength2);
					
					$vlSample1=0;
					$vlSample1=($vlSampleArray[0]/1)+($count-1);
					switch($sampleLengthFinal) {
						case "5":
							$vlSample1="00000".$vlSample1;
						break;
						case "4":
							$vlSample1="0000".$vlSample1;
						break;
						case "3":
							$vlSample1="000".$vlSample1;
						break;
						case "2":
							$vlSample1="00".$vlSample1;
						break;
						case "1":
							$vlSample1="0".$vlSample1;
						break;
					}
					
					$vlSampleID=0;
					$vlSampleID=$vlSample1."/".$vlSampleArray[1];
					//update vl_samples
					mysqlquery("update vl_samples set vlSampleID='$vlSampleID' where id='$qS[id]'");
				}
			}
		}
	}
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:57,代码来源:functions.samples.php

示例8: loadCountriesFromRegion

/**
* function to get specific countries from a region
* @param: $region e.g. africa, south america etc
*/
function loadCountriesFromRegion($region,$companyID) {
	if($region) {
		global $user;
	
		$theUserID=0;
		//ensure $user is not a visitor
		if(substr($user,0,7)!="visitor") {
			$theUserID=getUserID($user);
		}
	
		//get the towns first
		$query=0;
		$query=mysqlquery("select distinct countryID,country from vl_countries where region='$region' order by country");
		if(mysqlnumrows($query)) {
			$return=0;
			$return="
				<table width=\"100%\" border=\"0\">
				  <tr>
					<td colspan=\"2\">Select the markets covered:</td>
				  </tr>";
			$q=array();
			while($q=mysqlfetcharray($query)) {
				$return.="
						<tr>
							<td width=\"1%\"><input type=\"checkbox\" name=\"marketscoveredUnique[]\" value=\"$q[countryID]\" ".(checkMarketAgainstProvider($theUserID,$q["countryID"],$companyID)?"checked":"")."></td>
							<td width=\"99%\">$q[country]</td>
						</tr>";
			}
			$return.="</table>";
	
			return $return;
		} else {
			$return=0;
			$return="No countries found in database!";
	
			return $return;
		}
	}
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:43,代码来源:functions.countries.php

示例9: isDateInDB

    function isDateInDB($date) {
		$query=0;
		$query=mysqlquery("select * from vl_calendar where eventDate='$date'");
		if(mysqlnumrows($query)) {
			return 1;
		}
    }
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:7,代码来源:class_calendar.php

示例10: getRemovedData

/**
* get data for removal
* @param: $query
*/
function getRemovedData($query) {
	//removed data
	$removedData="";
	
	//get the table name, usually the 3rd word in the query
	$wordInQuery=array();
	$wordInQuery=explode(" ",$query);
	$tableName=0;
	$tableName=$wordInQuery[2];
	
	//get fields in table
	$tableQuery=0;
	$tableQuery=mysqlquery("desc $tableName");
	if(mysqlnumrows($tableQuery)) {
		$fieldsInTable=array();
		while($row=mysqlfetcharray($tableQuery)) {
			$fieldsInTable[]=$row["Field"];
		}
	}
	
	//switch statement from "delete from" to "select * from"
	$newQuery=0;
	$newQuery=preg_replace("/delete from/is","select * from",$query);
	
	//ran the select query
	$selectQuery=0;
	$selectQuery=mysqlquery($newQuery);
	if(mysqlnumrows($selectQuery) && count($fieldsInTable)) {
		for($i=0;$i<count($fieldsInTable);$i++) {
			$removedData.="$fieldsInTable[$i]::".mysqlresult($selectQuery,0,"$fieldsInTable[$i]").($i<(count($fieldsInTable)-1)?"|":"");
		}
	}
	
	//return
	return $removedData;
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:40,代码来源:functions.debug.php

示例11: lower

}

//should we send the password to an email?
if($remindEmail) {
	resetPassword($remindEmail);
	go("/sentreminder/$remindEmail/");
}

if($login && $email && $pass) {
	//validate
	$email=validate($email);
	
	//authenticate
	$u=0;
	$u=mysqlquery("select * from vl_users where lower(email)='".strtolower($email)."'");
	if(mysqlnumrows($u)) {
		while($un=mysqlfetcharray($u)) {
			if(strtolower($email)==strtolower($un["email"])) {
				//email authentic
				if(vlSimpleDecrypt($un["xp"])==hash("sha256",$pass)) {
					//has this account been de-activated?
					if(!$un["active"]) {
						go("/login/in/");
					} else {
						//register session variables
						$_SESSION["VLEMAIL"]=$email;
						//log
						mysqlquery("update vl_users set lastLogin='$datetime' where email='$_SESSION[VLEMAIL]'");
						//redirect
						go("/dashboard/welcome/");
					}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.home.prelogin.php

示例12: alterUserSetting

/**
* function to change a user's setting
* @param: $userID
* @param: $setting
* @param: $value
*/
function alterUserSetting($userID,$setting,$value) {
	//globals
	global $datetime,$trailSessionUser;
	
	//does user have a setting account?
	$query=0;
	$query=mysqlquery("select * from vl_users_settings where userID='$userID'");
	if(mysqlnumrows($query)) {
		//log table change
		logTableChange("vl_users_settings","$setting",getDetailedTableInfo2("vl_users_settings","userID='$userID'","id"),getDetailedTableInfo2("vl_users_settings","userID='$userID'","$setting"),$value);
		//update
		mysqlquery("update vl_users_settings set $setting='$value' where userID='$userID'");
	} else {
		//insert
		mysqlquery("insert into vl_users_settings 
						(userID,$setting,created,createdby) 
						values 
						('$userID','$value','$datetime','$trailSessionUser')");
	}
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:26,代码来源:functions.user.php

示例13: loadImage

/**
* load image
*/
function loadImage($url) {
	//get the corresponding file
	$query=0;
	$query=mysqlquery("select * from vl_filenames where fileurl='$url'");
	if(mysqlnumrows($query)) {
		//file missing
		if(!is_file(mysqlresult($query,0,'filepath'))) {
			//return db ref
			return "sys.viewfile.php?wR=".mysqlresult($query,0,'id');
		} else {
			$rand=0;
			$rand=rand(1,5);
			switch($rand) {
				case 5:
					return "sys.viewfile.php?wR=".mysqlresult($query,0,'id');
				break;
				case 4:
				case 3:
				case 2:
				case 1:
				default:
					return $url;
				break;
			}
		}
	} else {
		return $url;
	}
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:32,代码来源:functions.files.php

示例14: matchData

/**
* function to match data
* @param: $table
* @param: $option
* @param: $info
*/
function matchData($table,$comparefields,$returnfield,$searchterm,$options) {
	if($searchterm) {
		$ha=array();
		$ha=explode(",",$comparefields);
		//iterations
		foreach($ha as $h) {
			//trim
			$h=trim($h);
			//query
			$query=0;
			$query=mysqlquery("select $returnfield,match($h) against('$searchterm' in boolean mode) as score 
								from $table 
								where 
								$options and 
								(match($h) against('$searchterm' in boolean mode) or $h like '%$searchterm%') 
								order by score desc 
								limit 1");
			if(!mysqlerror()) {
				if(mysqlnumrows($query)) {
					return mysqlresult($query,0,$returnfield);
				}
			}
		}
	}
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:functions.tables.php

示例15: if

                    //how many pages are there?
                    if($numberPages>1) {
                        echo "<tr><td style=\"padding:0px 0px 10px 0px\" class=\"vls_grey\"><strong>Pages:</strong> ".displayPagesLinks("/verify/".($approvedstatus=="search"?"search/$encryptedSample":$approvedstatus)."/pg/",1,$numberPages,($pg?$pg:1),$default_radius)."</td></tr>";
                    }
                    
                    $numberOfRelevantSamples=0;
                    $numberOfRelevantSamples=getDetailedTableInfo3("vl_samples","verified=0","count(id)","num");
                    
                    $resultsPending=0;
                    $resultsPending=$numberOfRelevantSamples;
                    
                    $resultsProcessed=0;
                    $resultsProcessed=getDetailedTableInfo3("vl_samples"," verified=1","count(id)","num");
                    
                    $resultsSearch=0;
                    $resultsSearch=mysqlnumrows($query);
                ?>
                        <tr>
                            <td>
                                <table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <? if($approvedstatus=="pending") { ?>
                                  <td class="bluetab_active"><?php 
echo "Pending&nbsp;(" . number_format((double) $resultsPending) . ")";
?>
</td>
                                  <? } else { ?>
                                  <td class="bluetab_inactive"><a href="/verify/pending/">
                                    <?php 
echo "Pending&nbsp;(" . number_format((double) $resultsPending) . ")";
?>
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.verify.default.php


注:本文中的mysqlnumrows函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。