Nueva plantilla 'Green Solutions' del Plan Marketing de 195 €.
Nuevo diseño 'Pack básico' del Plan Marketing + Calendario de empresa + Catálogo de productos.
0
1 <?
2 class Conexion {
3 private $conexion;
4 private $host='mysql5-5.pro';
5 private $user='treeweb_text';
6 private $pass='1Qa2Ws';
7 private $database='treeweb_text';
8
9 private $n=0;
10
11 function __construct() {
12 $this->conexion = mysql_connect($this->host, $this->user, $this->pass);
13 mysql_select_db($this->database);
14 mysql_query("SET NAMES 'utf8'");
15 }
16
17 function sql($sql) {
18 if (is_array($sql)) {
19 foreach ($sql as $s) {
20 $res = mysql_query($s);
21 if (mysql_errno()) echo mysql_error().'<br>';
22 $this->n++;
23 }
24 } else {
25 $res = mysql_query($sql);
26 if (mysql_errno()) echo mysql_error().'<br>';
27 $this->n++;
28 }
29 return $res;
30 }
31
32 function __destruct() {
33 if (is_resource($this->conexion) )
34 mysql_close($this->conexion);
35 }
36
37 function getLink() {
38 return $this->conexion;
39 }
40
41 function instalar() {
42 // La instalación de esto no hace nada
43 }
44 }
45 ?>
46
47