Mi laptop tiene windows 7 Home Basic en 64 bits
Este es el script que utilizo para la conexion y las consultas...
Código PHP:
abstract class conexion
{
private static $db_host = 'localhost';
private static $db_user = 'usuario';
private static $db_pass = 'password';
protected $db_name = 'nombreBD';
private $con;
private function abrirConexion(){
$this->con = mysqli_connect(self::$db_host,self::$db_user,self::$db_pass,$this->db_name) or die("Error al conectarse a la base de datos");
}
protected function _error(){
return "Error :".mysqli_error($this->con);
}
protected function _query($query){
$this->abrirConexion();
$sql=mysqli_query($this->con,$query) or die($this->_error());
return $sql;
}
protected function _data($query){
$reg=mysqli_fetch_array($query);
return $reg;
}
protected function _num($query){
$num=mysqli_num_rows($query);
return $num;
}
protected function _beginwork(){
$this->abrirConexion();
mysqli_autocommit($this->con, FALSE);
}
protected function _commit(){
$this->abrirConexion();
mysqli_commit($this->con);
}
protected function _rollback(){
$this->abrirConexion();
mysqli_rollback($this->con);
}
}