Exemplo n.º 1
0
 public static function connect()
 {
     self::$_driverName = '';
     self::$_hostName = 'localhost';
     self::$_userName = '';
     self::$_schemaName = '';
     $password = '';
     $dsnString = self::$_driverName . ':host=' . self::$_hostName . ';dbname=' . self::$_schemaName . ';charset=utf8;';
     //$options = array();
     //$utf8 = array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8");
     try {
         self::$_connection = new PDO($dsnString, self::$_userName, $password);
         self::$_errorMessage = '';
     } catch (Exception $e) {
         self::$_errorMessage = $e->getMessage();
         return false;
     }
     return true;
 }
Exemplo n.º 2
0
 public function deleteEquipment($data)
 {
     $connected = BrowsePdo::connect();
     $sql = "DELETE FROM laptops where id = ?";
     $update = BrowsePdo::query($sql, array($data["id"]));
 }