This repository has been archived by the owner on Feb 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sqlfunctions.class.php
160 lines (160 loc) · 3.53 KB
/
sqlfunctions.class.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
/**
* Class that contains functions for managing connections
* @package PHP2HTML
* @subpackage databases
* @version 1.0 BETA
* @author MANUEL GONZALEZ RIVERA <[email protected]>
* @copyright Copyright (R) 2012, MANUEL GONZALEZ RIVERA <[email protected]>
* @license http://opensource.org/licenses/MIT MIT
*
*/
/**
* Class that contains functions for managing connections
*
* @abstract Class
* @package PHP2HTML
* @subpackage databases
* @version 1.0
* @author MANUEL GONZALEZ RIVERA <[email protected]>
* @copyright Copyright (R) 2012, MANUEL GONZALEZ RIVERA <[email protected]>
* @license http://opensource.org/licenses/MIT MIT
*
*/
abstract class SQLFunctions {
/**
* The active connection
*
* @var object Connection Object
*/
protected $conn;
/**
* The active recordset
*
* @var object Active Recordset
*/
public $rs;
/**
* Associative array with the current row
*
* @var array Current Row
* @see $rs
*/
public $row = array();
/**
* Active/Last Sql Query
*
* @var string SQL Query
*/
public $sql;
/**
* Database host
*
* @var string Database Host
*/
protected $host;
/**
* Database name
*
* @var string Database name
*/
protected $database;
/**
* Database username
*
* @var string Database User
*/
protected $user;
/**
* Database password
*
* @var string Database Password
*/
protected $password;
/**
* Defines if the connection is persistent
*
* @var string Connection Option
*/
protected $persistant;
/**
*
* @var object
*/
protected $HtmlC;
/**
* Abstract class for handling connections
*
* @param $host string
* @param $database string
* @param $user string
* @param $password string
* @param $persistant boolean
*/
abstract public function __construct($obj, $host, $database, $user, $password, $persistant);
/**
* Try running a SQL query. If the parameter is empty, it takes the variable $this->sql
*
* @param string $sql Sql Query
*/
abstract public function Query($sql = '');
/**
* Returns an associative array with the following record
*
* @param boolean $assoc
* @return mixed
*/
abstract public function Fetch($assoc = false);
/**
* Move the pointer to the index consultation indicated
*
* @param int $num
* @return boolean
*/
abstract public function Seek($num = 0);
/**
* Return the last id inserted
*
* @return int
*/
abstract public function getInsertedId();
/**
* Returns the number of rows affected by a query update, insert or delete
*
* @return int
*/
abstract public function affectedRows();
/**
* Returns the number of rows for a SELECT query resolved
*
* @return int
*/
abstract public function numRows();
/**
* Returns the number of columns in the query result
*
* @return int
* @throws ExceptionRecorset
*/
abstract public function numColumns();
/**
* Get the connection info
*
* return string
*/
abstract public function ConnSummary();
/**
* Open the connection
*
*/
abstract protected function Conn();
/**
* Close the connection
*/
abstract public function Close();
/**
* Destroy
*/
abstract public function __destruct();
}
?>