-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
55 lines (44 loc) · 1.09 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
class Functions
{
var $dbh = null;
var $conexion = null;
function Connect()
{
$this->dbh = @mysql_connect("localhost", "user", "pass") or die(mysql_error());
$this->conexion = mysql_select_db("db", $this->dbh) or die(mysql_error($this->dbh));
mysql_query ("SET NAMES 'utf8'");
}
function Disconnect()
{
mysql_close($this->dbh);
}
function Query($query)
{
$result = mysql_query($query, $this->dbh) or die ("Error al intentar enviar la información hacia el servidor ".mysql_error());
return $result;
}
function Fetch_Assoc($resp)
{
$sres = array();
while($result = mysql_fetch_assoc($resp))
$sres[] = $result;
return $sres;
}
function Num_Rows($resp)
{
return mysql_num_rows($resp);
}
function Fetch_Array($resp)
{
return mysql_fetch_array($resp,MYSQL_BOTH);
}
function Fetch_Array_Masive($resp)
{
$sres = array();
while($result = mysql_fetch_array($resp,MYSQL_BOTH))
$sres[] = $result;
return $sres;
}
}
?>