|
|
|
|
|
// This code was originaly written by Anton Stckl (tony@cys.de)
<?
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);
}
?>
|
|
| grab the result of any calculation you submit to the Google Calculator. Categories : PHP, Arrays, Web Services, Regexps, Math. | | | Finds the median in an array of numbers - Can be used with a MySql database column read into an array Categories : PHP, Arrays, Databases, MySQL | | | dynamic table columns Categories : PHP, HTML and PHP, Arrays, Databases, MySQL | | | BBCode Formatting String Categories : PHP, HTML, Regexps, Arrays | | | create a grid out of <INPUT TYPE=TEXT> then saving to a database. Uses
a 'multi-dimension array', but not really as the array is just one big array
with the index of "[$i][$j]". Have a look at the code and you'll see what I
mean. Categories : PHP, MySQL, Arrays, Databases | | | CSS style switcher Categories : PHP, CSS, HTML and PHP, Arrays, Sessions | | | Link Submition - Allow your visitors to submit links to the site. Categories : PHP, Arrays, Filesystem, Beginner Guides | | | Simple conversion functions to change MySQL dates to arrays, arrays to MySQL dates.
Categories : PHP, Arrays, Date Time, Databases, MySQL | | | Array Insertion Categories : PHP, PHP Classes, Arrays | | | array -- Create an array Categories : PHP, PHP Functions, Arrays | | | How to get the source of a site into an array. Categories : Arrays, HTML, PHP | | | Simple script to passing persistent and growing array between recalls of one page (manipulate little stack). Categories : Arrays, Global Variables, PHP, HTML and PHP, Variables | | | How to append arrays - fill an Array with dynamic values. Categories : Arrays, PHP | | | PHPDRAW, the php wannabe Photoshop ;-) Categories : PHP, PHP Classes, GD image library, Arrays | | | How to load a query result into a PHP Array Categories : PHP, Databases, Arrays, MySQL | |
| |
| |
|