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


PHP myclass::select方法代碼示例

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


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

示例1: myclass

/**
 * @param string $email The email hash
 * @param string $s Size in pixels, defaults to 80px [ 1 - 512 ]
 * @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ]
 * @param string $r Maximum rating (inclusive) [ g | pg | r | x ]
 * for more info : http://gravatar.com/site/implement/images/php/ 
 */
	function get_gravatar( $email, $s = 20, $d = 'identicon', $r = 'g') {
		
		$obj = new myclass();
		$sql = "SELECT members.*,member_photos.photo, member_photos.Approve FROM members LEFT JOIN member_photos ON members.id = member_photos.member_id WHERE md5(members.email_id)='".$email."'";
		$sql_res=$obj->select($sql);
				
		$path = "upload/".$sql_res[0]['photo'];
		
		if(!empty($sql_res[0]['photo']) && $sql_res[0]['Approve']==1)
		{
			if (file_exists($path)) 
			{
				$avatarSrc=$path;
			}
			else
			{
				if($sql_res[0]['gender']=='M')
				{
					$avatarSrc='images/male-user1.png';
				}
				else
				{
					$avatarSrc='images/female-user1.png';
				}
			}
		}
		else
		{
			if($sql_res[0]['gender']=='M')
			{
				$avatarSrc='images/male-user1.png';
			}
			else
			{
				$avatarSrc='images/female-user1.png';
			}
		}
		
		//$url = 'gravatar.com/avatar/';
	    //$url .= "$email?s=$s&d=$d&r=$r";
	    //return $url;
		return $avatarSrc;
	}
開發者ID:OkyJ,項目名稱:findmyjodi,代碼行數:50,代碼來源:chat.class.php

示例2: quotations_total

function quotations_total($id = '')
{
    $obj = new myclass();
    $select_quotations_product = "select * from tbl_quotations_product where Qid='" . $id . "'";
    $db_quotations_product = $obj->select($select_quotations_product);
    $total = 0;
    for ($i = 0; $i < count($db_quotations_product); $i++) {
        $total = $total + $db_quotations_product[$i]['Total'];
    }
    return $total;
}
開發者ID:honey93,項目名稱:Real-Estate,代碼行數:11,代碼來源:functions.php


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