PHP: maxdb_stmt_fetch - Manual in Deutsh
PHP: maxdb_stmt_fetch - Manual in French
PHP: maxdb_stmt_fetch - Manual in Polish

You Are At PHP: maxdb_stmt_fetch - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

maxdb_stmt_fetch

(PECL)

maxdb_stmt_fetch

(no version information, might be only in CVS)

stmt->fetch -- Fetch results from a prepared statement into the bound variables

Description

Procedural style:

bool maxdb_stmt_fetch ( resource stmt )

Object oriented style (method):

class stmt {

bool fetch ( void )

}

maxdb_stmt_fetch() returns row data using the variables bound by maxdb_stmt_bind_result().

Note: Note that all columns must be bound by the application before calling maxdb_stmt_fetch().

Return values

Table 1. Return values

ValueDescription
TRUESuccess. Data has been fetched
FALSEError occured
NULLNo more rows/data exists

See also

maxdb_prepare(), maxdb_stmt_errno(), maxdb_stmt_error(), maxdb_stmt_bind_result()

Example

Example 1. Object oriented style

<?php
$maxdb
= new maxdb("localhost", "MONA", "RED", "DEMODB");

/* check connection */
if (maxdb_connect_errno()) {
   
printf("Connect failed: %s\n", maxdb_connect_error());
   exit();
}

$query = "SELECT zip, name FROM hotel.city ORDER by name";

if (
$stmt = $maxdb->prepare($query)) {

   
/* execute statement */
   
$stmt->execute();

   
/* bind result variables */
   
$stmt->bind_result($name, $code);

   
/* fetch values */
   
while ($stmt->fetch()) {
       
printf ("%s (%s)\n", $name, $code);
   }

   
/* close statement */
   
$stmt->close();
}

/* close connection */
$maxdb->close();
?>

Example 2. Procedural style

<?php
$link
= maxdb_connect("localhost", "MONA", "RED", "DEMODB");

/* check connection */
if (maxdb_connect_errno()) {
   
printf("Connect failed: %s\n", maxdb_connect_error());
   exit();
}

$query = "SELECT zip, name FROM hotel.city ORDER by name";

if (
$stmt = maxdb_prepare($link, $query)) {

   
/* execute statement */
   
maxdb_stmt_execute($stmt);

   
/* bind result variables */
   
maxdb_stmt_bind_result($stmt, $name, $code);

   
/* fetch values */
   
while (maxdb_stmt_fetch($stmt)) {
       
printf ("%s (%s)\n", $name, $code);
   }

   
/* close statement */
   
maxdb_stmt_close($stmt);
}

/* close connection */
maxdb_close($link);
?>

The above examples would produce the following output:

12203 (Albany)
60601 (Chicago)
60615 (Chicago)
45211 (Cincinnati)
33575 (Clearwater)
75243 (Dallas)
32018 (Daytona Beach)
33441 (Deerfield Beach)
48226 (Detroit)
90029 (Hollywood)
92714 (Irvine)
90804 (Long Beach)
11788 (Long Island)
90018 (Los Angeles)
70112 (New Orleans)
10019 (New York)
10580 (New York)
92262 (Palm Springs)
97213 (Portland)
60018 (Rosemont)
95054 (Santa Clara)
20903 (Silver Spring)
20005 (Washington)
20019 (Washington)
20037 (Washington)

oprogramowanie magazynowe
Najtańszy fotograf lublin na ślub
kody kreskowe paskowe RFID Czytniki mobilne drukarki etykiet termina
Pozycjonowanie stron
Dostawca kas fiskalnych w Białymstoku

Another Useful functions:


ref.maxdb | function.maxdb-warning-count | function.maxdb-use-result | function.maxdb-thread-safe | function.maxdb-thread-id | function.maxdb-store-result | function.maxdb-stmt-store-result | function.maxdb-stmt-sqlstate | function.maxdb-stmt-send-long-data | function.maxdb-stmt-result-metadata | function.maxdb-stmt-reset | function.maxdb-stmt-prepare | function.maxdb-stmt-param-count | function.maxdb-stmt-num-rows | function.maxdb-stmt-init | function.maxdb-stmt-free-result | function.maxdb-stmt-fetch | function.maxdb-stmt-execute | function.maxdb-stmt-error | function.maxdb-stmt-errno | function.maxdb-stmt-data-seek | function.maxdb-stmt-close | function.maxdb-stmt-close-long-data | function.maxdb-stmt-bind-result | function.maxdb-stmt-bind-param | function.maxdb-stmt-affected-rows | function.maxdb-stat | function.maxdb-ssl-set | function.maxdb-sqlstate | function.maxdb-set-opt | function.maxdb-server-init | function.maxdb-server-end | function.maxdb-send-query | function.maxdb-send-long-data | function.maxdb-select-db | function.maxdb-rpl-query-type | function.maxdb-rpl-probe | function.maxdb-rpl-parse-enabled | function.maxdb-rollback | function.maxdb-report | function.maxdb-real-query | function.maxdb-real-escape-string | function.maxdb-real-connect | function.maxdb-query | function.maxdb-prepare | function.maxdb-ping | function.maxdb-param-count | function.maxdb-options | function.maxdb-num-rows | function.maxdb-num-fields | function.maxdb-next-result | function.maxdb-multi-query | function.maxdb-more-results | function.maxdb-master-query | function.maxdb-kill | function.maxdb-insert-id | function.maxdb-init | function.maxdb-info | function.maxdb-get-server-version | function.maxdb-get-server-info | function.maxdb-get-proto-info | function.maxdb-get-metadata | function.maxdb-get-host-info | function.maxdb-get-client-version | function.maxdb-get-client-info | function.maxdb-free-result | function.maxdb-field-tell | function.maxdb-field-seek | function.maxdb-field-count | function.maxdb-fetch | function.maxdb-fetch-row | function.maxdb-fetch-object | function.maxdb-fetch-lengths | function.maxdb-fetch-fields | function.maxdb-fetch-field | function.maxdb-fetch-field-direct | function.maxdb-fetch-assoc | function.maxdb-fetch-array | function.maxdb-execute | function.maxdb-escape-string | function.maxdb-error | function.maxdb-errno | function.maxdb-enable-rpl-parse | function.maxdb-enable-reads-from-master | function.maxdb-embedded-connect | function.maxdb-dump-debug-info | function.maxdb-disable-rpl-parse | function.maxdb-disable-reads-from-master | function.maxdb-debug | function.maxdb-data-seek | function.maxdb-connect | function.maxdb-connect-error | function.maxdb-connect-errno | function.maxdb-commit | function.maxdb-close | function.maxdb-close-long-data | function.maxdb-client-encoding | function.maxdb-character-set-name | function.maxdb-change-user | function.maxdb-bind-result | function.maxdb-bind-param | function.maxdb-autocommit | function.maxdb-affected-rows |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.