热门资讯

php mysql查询类

php mysql查询类?php class Ring{var $q_uid;var $q_name;var $q_type;var
$q_head;var $q_sex;var $q_reg;public check_user($id){$sql=Select *
from gx_member where id=’$id’;$result=mysql_query($sql) or
die(mysql_error());if (mysql_num_rows( $result )
){$rs=mysql_fetch_object( $result);if( $rs-m_lock==’1′
){exit(‘对不起,你己被管理员锁定了’);}elseif( $rs-m_del ==’1′)
{exit(‘此用户己被删除’);}else{$this-q_uid
=$id;$this-q_name=$rs-m_name;$this-q_head=$rs-m_head$this-q_sex
=$rs-sex == ‘1’? ‘男’:’女’;$this-q_reg
=$rs-m_time;$this-q_type=$rs-type;}}else{exit(‘用户不存了..a href=#
onclick=’history.back();’点击返回/a’);}}public
member_article(){$article_list =Select * from gx_q where
member_id=’$this-q_uid;if( ‘0’ == $this-query($article_list) ){echo
‘暂时无信息’;}else{foreach( $this-result as $list){$size
=sizeof($list);for($i=0;$i=$size;$i++){/* 222*/}}}public
query($sql){if( empty( $sql) ){return
‘0’;}else{$result=mysql_query($sql) or die(mysql_error());if(
mysql_num_rows ($result) ){$array=array();while(
$rs=mysql_fetch_array($result)
)$array[]=$rs;}$this-result=$array;}else{return
‘0’;}mysql_free_result($result);}}}?注:本站原创转载注明:

发表评论

电子邮件地址不会被公开。 必填项已用*标注

相关文章