Returns the array data.
Syntax: array sybase_fetch_array (int result);
return value: Array
Function Type: Database function
Content Description
This function is used to split the result of the query into an array variable. If result has no data, a value of false is returned. This function can be said to be a reinforcing function of Sybase_fetch_row (), in addition to the return column and the numeric index can be placed in the array, you can also put the text index into the array.
Usage examples
This is an example from joey@samaritan.com (22-feb-1999)
Example 1:
Copy the Code code as follows:
$q = Sybase_query ("Select COUNT (DISTINCT opportunity_id) from m_opp_interests WHERE interest_id = $i _id", $db);
while ($op _by_int = Sybase_fetch_array ($q)) {
while (list ($k, $v) = each ($op _by_int)) {
echo "\ $op [$k] = $v \ n";
}
?>
The return information is as follows
$op [0] = 2164
$OP [Computed] = 2164
Example 2:
Copy the Code code as follows:
$DBH = Sybase_connect (' Sybase ', ' ', ');
$q = Sybase_query (' SELECT * from P, a WHERE p.person_id= a.person_id ');
Var_dump (Sybase_fetch_array ($q));
Sybase_close ($DBH);
?>
The above example would produce the following output (assuming the both tables only has each one column called "person_id" ):
Copy the Code code as follows:
Array (4) {
[0]=>
Int (1)
["person_id"]=>
Int (1)
[1]=>
Int (1)
["Person_id1"]=>
Int (1)
}
http://www.bkjia.com/PHPjc/754796.html www.bkjia.com true http://www.bkjia.com/PHPjc/754796.html techarticle returns the array data. Syntax: array sybase_fetch_array (int result); Return value: Array function Type: Database function Description This function is used to split the result of the query into an array ...