Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $updated = $db->query('update urc set retime=? where a=? and b=? and c=?',[time(),$a,$b,$c]);
- echo $updated->rowCount();
- $updated = $db->query('select 1 from urc where a=? and b=? and c=?',[$a,$b,$c]);
- echo $updated->rowCount();
- class PDOSQL{
- private static
- $username="root",
- $password="",
- $host="127.0.0.1",
- $dbh;
- public function connect($dbname){
- return (self::$dbh = new PDO("mysql:dbname=".$dbname.";host=".self::$host, self::$username, self::$password,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")));
- }
- public function query($sql, $args){
- $stmt = self::$dbh->prepare($sql);
- $stmt->execute($args);
- return $stmt;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement