PHP 精髓代码

$onecontentdata = mysqld_select("select * from zz_content as t1 left join zz_content_ext as t2 on t1.id=t2.content_id where id = ".$_GP['id']);
        //查询一条类目数据
<?php if(strpos($item['delete'],','.$_GP['category_id'].',')===false){ echo '屏蔽';}else{echo '解除屏蔽';}?>
//在HTML里面使用

 

//删除    (表不需要跟前缀,条件);     
mysqld_delete("content",array("id"=>1));

//查询一条数据  (表要前缀,条件)
mysqld_select(table("content", array("id"=>1));


//插入数据        (表,数据)
 mysqld_insert("content",  array())
//会自动卸载没有的段名的值


//修改更新  (表,更新数据,条件) //不需要跟 AND
mysqld_update("content", $data = array(), $params = array(), $orwith = 'AND');
//会自动卸载没有的段名的值

//返回插入上一个的id
insertid();
//___________________________________________________________________________________________________
//示例:
////比如查询会员登陆 密码 是否正确   如果返回1条数据说明会员和密码正确
$onememberdata = mysqld_select("select * from zz_member where username = :username and password = :password",array(':username'=>$_GP['info']['username'],":password"=>md5($_GP['info']['password'])));
//这样可以防止注入
$status_id=mysqld_select("select status from zz_member where username = :username",array(':username'=>$_GP['info']['username']));

 

posted @ 2018-03-19 15:12  xiaohe520  阅读(193)  评论(0编辑  收藏  举报