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 a query into an array variable. Returns the value of False if result has no data. This function can be said to be a 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 of joey@samaritan.com (22-feb-1999)
Example 1:
Copy Code code as follows:
<?php
$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 (the 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 Code code as follows:
<?php
$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 following output (assuming the two tables only have each one column called "person_id" ):
Copy Code code as follows:
Array (4) {
[0]=>
Int (1)
["person_id"]=>
Int (1)
[1]=>
Int (1)
["Person_id1"]=>
Int (1)
}