Esempio n. 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);
 }
Esempio n. 2
0
function reqstr($name, $init, $allowempty = FALSE)
{
    $rea = is_str(req($name), $init);
    if (!$allowempty && $rea == '') {
        $rea = $init;
    }
    return $rea;
}