2011-04-04 15:16:10 +00:00
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
* Clase BD
|
|
|
|
|
*
|
|
|
|
|
* Sirve para conectarse a la base de datos y realizar consultas sobre esta
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
include_once("ConexionBackup.php");
|
|
|
|
|
|
|
|
|
|
class BDBackup{
|
|
|
|
|
|
|
|
|
|
private $conexion;
|
|
|
|
|
|
|
|
|
|
function BDBackup(){
|
|
|
|
|
$this->conexion = new ConexionBackup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function execQuery($query){
|
|
|
|
|
$res = mysql_query($query);
|
2011-04-06 16:50:55 +00:00
|
|
|
$mensaje = $query." - ".$res."\r\n";
|
|
|
|
|
$fichero = fopen("querys.log","a");
|
|
|
|
|
fputs($fichero,$mensaje);
|
|
|
|
|
fclose($fichero);
|
2011-04-04 15:16:10 +00:00
|
|
|
return $res;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function arrayQuery($query, $campo){
|
|
|
|
|
$array = array();
|
|
|
|
|
$resultado = $this->execQuery($query);
|
|
|
|
|
if($resultado){
|
|
|
|
|
while($rows = mysql_fetch_assoc($resultado)){
|
|
|
|
|
$array[] = $rows[$campo];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $array;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getLink(){
|
|
|
|
|
return $this->conexion->getlink();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
?>
|