class Samplepeer extends Peer {
function __construct(Database $hconn){
parent::__construct($hconn);
$this->arrSql['sql_section']='thule';
}
function select_member($arrSql) {
$arrSql['sql_key']='thule';
return $this->select($arrSql);
}
function static_select_member($arrSql) {
$arrSql['sql_section']='static_thule';
$arrSql['sql_key']='thule';
return $this->select($arrSql,QUERY_STATIC);
}
function update_member($arrSql) {
$arrSql['sql_key']='thule_update';
$this->execute($arrSql);
}
}
$hconn=&$this->opendb('default');
$this->loadPeer("samplepeer",$hconn);
$this->Samplepeer->select_member($arr_sql);
class Samplepeer extends Peer {
function __construct(Database $hconn){
parent::__construct($hconn);
$this->arrSql['sql_section']='thule';
}
}
...........
<thule>
......
<query key='thule'> select * from db_thule.tb_member where member_id='$member_id' </query>
.......
</thule>
<blog>
......
<query key='select_blog'> select * from tb_blog where member_id='?' </query>
.......
</blog>
<home>
......
<query key='select_home'> select * from tb_home where member_id='$member_id' </query>
.......
</home>
............
$arrSql['sql_key']='thule';
<query key='thule'> select * from db_thule.tb_member where member_id='$member_id' </query>
$arr_sql['query_values']=array(1,2,3);
$result=$this->Sample->select_static_member($arr_sql);
<query key='thule'> select * from db_thule.tb_member where a='?' and b='?' and c='?' </query>
select * from db_thule.tb_member where a='1' and b='2' and c='3'