PHP Sybase_fetch_array How to use _php tutorials

Source: Internet
Author: User
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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.