search
Homephp教程php手册php sybase_fetch_array usage method_php basics

Return 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 query result result into an array variable. If result has no data, a false value is returned. This function can be said to be an enhanced function of sybase_fetch_row(). In addition to putting the returned column and numeric index into the array, you can also put the text index into the array.
Usage Example
This is an example submitted by joey@samaritan.com (22-Feb-1999)

Example 1:

Copy code The code is 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";
}
?>
P>

The return information is as follows

$op[0] => 2164
$op[computed] => 2164

Example 2:

Copy code The code is 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 two tables only have each one column called "person_id"):

Copy code The code is as follows:

array(4) {
[0] =>
int(1)
["person_id"]=>
int(1)
[1]=>
int(1)
["person_id1"]= >
int(1)
}
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)