note 46524 added to function.pg-fetch-row
| From: | maxnamara at yahoo dot com | Date: | Thu, 14 Oct 2004 07:03:07 +0000 |
| Subject: | note 46524 added to function.pg-fetch-row | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78526@lists.php.net to get a copy of this message | ||
Get downlines, put them into arrays.
function get_downlines($my_code){
global $link;
$sql = "select user_id, name from tb_user where parentcode = $my_code";
$res = pg_query($link,$sql);
if(!$res){
echo "Error: ".$sql;exit();
}
$num_fields = pg_num_fields($res);
$info_rows = 0;
$num_rows = pg_num_rows($res);
while($arr = pg_fetch_row($res)){
$info_offset = 1;
$info_columns = 0;
while ($info_offset <= $num_fields) {
$info_elements[$info_rows][$info_columns] = $arr[$info_columns];
$info_offset++; $info_columns++;
}
$info_rows++;
}
return $info_elements;
}
----
Manual Page -- http://www.php.net/manual/en/function.pg-fetch-row.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46524
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46524&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46524&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46524&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46524&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46524&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46524&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46524&report=yes
Search -- http://master.php.net/manage/user-notes.php