本文整理汇总了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;
}
示例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;
}