<pre><?php class DB extends PDO { protected $db_name = "xxxxx"; protected $db_user = "root"; protected $db_pass = ""; protected $db_host = "localhost"; public function __construct() { try { parent::__construct("mysql:host={$this->db_host};dbname={$this->db_name}", $this->db_user, $this->db_pass); } catch (PDOException $e) { echo $e->getMessage(); } } public function delete($table,$cond,$limit=1){ $sql = "DELETE FROM $table WHERE $cond LIMIT $limit "; return $this->DBconnect->exec($sql); } } ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)