PHP 8.4.0 RC3 available for testing

mysql_fetch_row

(PHP 4, PHP 5)

mysql_fetch_rowGet a result row as an enumerated array

Avviso

Questa enstensione deprecata da PHP 5.5.0, e sarà rimossa in futuro. Al suo posto, usare l'estensione MySQLi o PDO_MySQL. Vedere anche la guida MySQL: scelta dell'API e le FAQ relative per ulteriori informazioni. Le alternative a questa funzione includono:

Descrizione

mysql_fetch_row(resource $result): array

Returns a numerical array that corresponds to the fetched row and moves the internal data pointer ahead.

Elenco dei parametri

result

The risultato resource che che viene calcolato. Questo risultato deriva dal una chiamata a mysql_query().

Valori restituiti

Returns an numerical array of strings that corresponds to the fetched row, or false if there are no more rows.

mysql_fetch_row() fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0.

Esempi

Example #1 Fetching one row with mysql_fetch_row()

<?php
$result
= mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!
$result) {
echo
'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);

echo
$row[0]; // 42
echo $row[1]; // the email value
?>

Note

Nota: Questa funzione imposta i campio NULL al valore PHP null.

Vedere anche:

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top