Php > Arrays
Call by reference and multidimensional arrays.
Call by reference and multidimensional arrays. function GetDBRows ($result, $data) { $rows = pg_NumRows($result); $fields = pg_NumFields($result); for ($i = 0; $i < $rows; $i++) { for ($k = 0; $k < $fields; $k++) { $tmp = pg_result($result, $i, $k); $data[$i][$k] = "$tmp"; } } } $c = pg_connect("..."); $result = pg_exec($c, "select ..."); GetDBRows($result, &$foo); while ($array = current($foo)) { while ($string = current($array)) { echo $string . "\n"; next($array); } next($foo); } ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage