예제 #1
0
 function bind($param, $value, $type = null)
 {
     switch ($value) {
         case is_int($value):
             $type = PDO::PARAM_INT;
             break;
         case is_str($value):
             $type = PDO::PARAM_STR;
             break;
         default:
             $type = PDO::PARAM_STR;
             break;
     }
     $this->stmt->bindValue($param, $value, $type);
 }
예제 #2
0
파일: common.php 프로젝트: haitao1880/study
function reqstr($name, $init, $allowempty = FALSE)
{
    $rea = is_str(req($name), $init);
    if (!$allowempty && $rea == '') {
        $rea = $init;
    }
    return $rea;
}