note 115407 added to pdostatement.bindparam
| From: | OfirAttia | Date: | Sat, 19 Jul 2014 06:09:47 +0000 |
| Subject: | note 115407 added to pdostatement.bindparam | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199975@lists.php.net to get a copy of this message | ||
/*
method for pdo class connection, you can add your cases by yourself and use it.
*/
class Conn{
....
....
private $stmt;
public function bind($parameter, $value, $var_type = null){
if (is_null($var_type)) {
switch (true) {
case is_bool($value):
$var_type = PDO::PARAM_BOOL;
break;
case is_int($value):
$var_type = PDO::PARAM_INT;
break;
case is_null($value):
$var_type = PDO::PARAM_NULL;
break;
default:
$var_type = PDO::PARAM_STR;
}
}
$this->stmt->bindValue($parameter, $value, $var_type);
}
----
Server IP: 72.52.91.14
Probable Submitter: 84.95.215.88
----
Manual Page -- http://php.net/manual/en/pdostatement.bindparam.php
Edit -- https://master.php.net/note/edit/115407
Del: integrated -- https://master.php.net/note/delete/115407/integrated
Del: useless -- https://master.php.net/note/delete/115407/useless
Del: bad code -- https://master.php.net/note/delete/115407/bad+code
Del: spam -- https://master.php.net/note/delete/115407/spam
Del: non-english -- https://master.php.net/note/delete/115407/non-english
Del: in docs -- https://master.php.net/note/delete/115407/in+docs
Del: other reasons-- https://master.php.net/note/delete/115407
Reject -- https://master.php.net/note/reject/115407
Search -- https://master.php.net/manage/user-notes.php