當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataBase::ExecuteQuery方法代碼示例

本文整理匯總了PHP中DataBase::ExecuteQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataBase::ExecuteQuery方法的具體用法?PHP DataBase::ExecuteQuery怎麽用?PHP DataBase::ExecuteQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DataBase的用法示例。


在下文中一共展示了DataBase::ExecuteQuery方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getOnePhotoRandom

 function getOnePhotoRandom($idalbum)
 {
     $sql = "SELECT * FROM photos WHERE idalbum=" . $idalbum;
     $rs = DataBase::ExecuteQuery($sql, "ARRAY");
     $ph = $rs[array_rand($rs, 1)];
     $this->setPhoto($ph['idphoto'], $ph['name'], $ph['src'], $ph['title'], $ph['idalbum'], $ph['fecha']);
 }
開發者ID:risos007,項目名稱:thechurch,代碼行數:7,代碼來源:Photo.class.php

示例2: Render

	public static function Render($qry, $list, $orderby, $tampag = 50, $pag){

	$original_qry = $qry;
	$qry = GridSortPage::SortQuery($qry, $orderby);
	$qry =  GridSortPage::PaginateQuery($qry, $pag, $tampag);

	
	$matrix = DataBase::ExecuteQuery($qry);

		$html = "\n<table>\n";
		$html .= GridSortPage::GetHeader($qry);
					 
		foreach($matrix as $key => $rows){	
			$html .= "<tr>";
							
			foreach($rows as $index => $column){					
					if($key%2 == 0)		$html .= "<td>".$column."</td>";
					else				$html .= "<td class=\"selectedRow\">".$column."</td>";
			}		

			#============================================================================
			
			#============================================================================
			
			#-------
			$html .= "<td>";
			if(isset($has_header) && $key == 0){
				$html .= "Opciones";
			}else{
			
			/*$html .= "<ul id=\"sddm\">
					    <li>
						<a href=\"#\" onmouseover=\"mopen('m$key')\" onmouseout=\"mclosetime()\">Opciones</a> 
						<div id=\"m$key\" onmouseover=\"mcancelclosetime()\" onmouseout=\"mclosetime()\">";*/
			
				foreach($list as $url)
				{
					if(get_class($url)=='HTMLCheckBox')
						$html.=$url->fillfromColumn($rows,"msgs[]",0)."\n";
					else 
						$html .= $url->Render($rows)."\n";
				}
					
			$html .= "</div>
					</li>
				</ul>
				<div style=\"clear:both\"></div>";
			}
			$html .= "</td>";
			#-------				
			$html .= "\n</tr>\n";	
			if(isset($has_header) && $key ==0) $html .= "</thead>";
	
		}
		$html .= "</table>\n";	
		$html .= GridSortPage::GetNavigationControlsHTML($original_qry, $tampag, $orderby);
		return $html;
	 } #GetHTMLTable
開發者ID:risos007,項目名稱:thechurch,代碼行數:58,代碼來源:GridSortPage.class.php

示例3: getOneAlbum

 public static function getOneAlbum($idalbum)
 {
     $ab = null;
     $sql = "SELECT a.idalbum, a.descripcion, COUNT(1) nophotos, a.fecha\r\n\t\tFROM albums a, photos p \r\n\t\tWHERE a.idalbum=p.idalbum\r\n\t\tAND a.idalbum=" . $idalbum . "\r\n\t\tGROUP BY a.idalbum, a.descripcion, a.fecha";
     $rs = DataBase::ExecuteQuery($sql, "ARRAY");
     //if(count($rs)>0)
     $ab = new Album($rs[0]['idalbum'], $rs[0]['descripcion'], $rs[0]['nophotos'], $rs[0]['fecha']);
     return $ab;
 }
開發者ID:risos007,項目名稱:thechurch,代碼行數:9,代碼來源:Album.class.php

示例4: Login

	public static function Login ($login_name, $pass, $redirect)
	{
		$md5pass = md5($pass);
		$user_exists = DataBase::ExecuteScalar("SELECT count(1) FROM users WHERE login = '$login_name' AND password = '$md5pass'");
		if($user_exists == 1){

		$qry = "SELECT * FROM users WHERE login = '$login_name' AND password = '$md5pass'";
		//echo $qry;
		$row = DataBase::ExecuteQuery($qry);
		$_SESSION["user"] = new User($row[0][0], $row[0][1], $row[0][2], $row[0][3], $row[0][4], $row[0][5]);
		
		//print_r($row);
		#-----------------------------
		echo "<script>window.location = '$redirect'</script>"; 
		}else{
		echo "Nombre de Usuario y Contraseña no coinciden, Favor de reintentar.";
		}
	}
開發者ID:risos007,項目名稱:thechurch,代碼行數:18,代碼來源:User.class.php

示例5: Load

    public static function Load(&$object, $sql)
    {
		$results = DataBase::ExecuteQuery($sql, "ARRAY");
		
		
		$keys = array_keys($results[0]);
		$string_keys = array();
		
		foreach($keys as $value){
			if(!is_int($value))
				array_push($string_keys, $value);
		}
		$row = $results[0];

		foreach($string_keys as $value)
			$object->$value = $row[$value];			

    }
開發者ID:risos007,項目名稱:thechurch,代碼行數:18,代碼來源:ORM.class.php

示例6: FillDB

function FillDB($qry, $value="")
{
	$rows = DataBase::ExecuteQuery($qry);
	foreach($rows as $key => $row)
		$this->AddItem ($row[0],$row[1]);	
}
開發者ID:risos007,項目名稱:thechurch,代碼行數:6,代碼來源:ComboBox.class.php

示例7: count

						<?php 
$sql = "SELECT idnews,title,fddate FROM news WHERE ambit=1 ORDER BY fddate DESC LIMIT 5";
$rs = DataBase::ExecuteQuery($sql, "ARRAY");
$i = count($rs);
foreach ($rs as $row => $value) {
    $class = $row == '0' ? 'class="first"' : '';
    echo '<li ' . $class . ' >';
    echo '<a href="javascript:;" onclick="get(\'panel_control/viewer_news.php?id=' . $value['idnews'] . '\',\'content\');" >' . $value['title'] . '</a>';
    echo '</li>';
}
?>
							
						</ul>
					</div>
					<div class="box">
						<h3>Eventos</h3>
						<ul class="list">
						<?php 
$sql = "SELECT idnews,title,fddate FROM news WHERE ambit=2 ORDER BY fddate DESC LIMIT 5";
$rs = DataBase::ExecuteQuery($sql, "ARRAY");
$i = count($rs);
foreach ($rs as $row => $value) {
    $class = $row == '0' ? 'class="first"' : '';
    echo '<li ' . $class . ' >';
    echo '<a href="javascript:;" onclick="get(\'panel_control/viewer_news.php?id=' . $value['idnews'] . '\',\'content\');" >' . $value['title'] . '</a>';
    echo '</li>';
}
?>
						</ul>
					</div>
				</div>
開發者ID:risos007,項目名稱:thechurch,代碼行數:31,代碼來源:menu.php


注:本文中的DataBase::ExecuteQuery方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。