Skip to content

Commit 0443ab1

Browse files
committed
Merge pull request a1phanumeric#2 from W4RH4WK/master
ArrayResults added
2 parents 076e5b2 + 99503d9 commit 0443ab1

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

class.MySQL.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
<?php
2+
/*
3+
* Copyright (C) 2011
4+
* Ed Rackham (http://github.com/a1phanumeric/PHP-MySQL-Class)
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
220
// MySQL Class
321
class MySQL {
422
// Base variables
@@ -229,6 +247,15 @@ function ArrayResult(){
229247
$this->aArrayedResult = mysql_fetch_assoc($this->aResult) or die (mysql_error());
230248
return $this->aArrayedResult;
231249
}
250+
251+
// 'Arrays' multiple result
252+
function ArrayResults(){
253+
$this->aArrayedResults = array();
254+
for ($i = 0; $aData = mysql_fetch_assoc($this->aResult); $i++){
255+
$this->aArrayedResults[] = $aData;
256+
}
257+
return $this->aArrayedResults;
258+
}
232259

233260
// 'Arrays' multiple results with a key
234261
function ArrayResultsWithKey($sKey='id'){
@@ -258,4 +285,5 @@ function SecureData($aData){
258285
return $aData;
259286
}
260287
}
261-
?>
288+
?>
289+

0 commit comments

Comments
 (0)