Files
youlegames/codes/agent/game/api/lib/phprs/ezsql/SqlConetxt.php
2026-03-15 01:27:05 +08:00

37 lines
821 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* $Id: SqlConetxt.php 131 2015-10-10 02:25:57Z yangmin.cao $
* @author caoym(caoyangmin@gmail.com)
*/
namespace phprs\ezsql;
/**
* @author caoym
*/
class SqlConetxt{
/**
* 拼接sql语句并自动插入空格
* @param string $sql 表达式
*/
public function appendSql($sql, $addSpace=true){
if($this->sql == ''){
$this->sql = $sql;
}else{
if($addSpace){
$this->sql = $this->sql.' '.$sql;
}else{
$this->sql = $this->sql.$sql;
}
}
}
/**
* 增加绑定变量值
* @param array $params 变量
*/
public function appendParams($params){
$this->params = array_merge($this->params, $params);
}
public $sql='';
public $params=[];
}