|
mysqli_result::fetch_assocmysqli_fetch_assocFetch a result row as an associative array BeschreibungObjektorientierter Stil
array mysqli_result::fetch_assoc
( void
)
Prozeduraler Stil
array mysqli_fetch_assoc
( mysqli_result
$result
)
Returns an associative array that corresponds to the fetched row or
Parameter-Liste
Rückgabewerte
Returns an associative array of strings representing the fetched row in the result
set, where each key in the array represents the name of one of the result
set's columns or If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the same name, you either need to access the result with numeric indices by using mysqli_fetch_row or add alias names. BeispieleBeispiel #1 Objektorientierter Stil
<?phpBeispiel #2 Prozeduraler Stil
<?phpDie obigen Bespiele erzeugen folgende Ausgabe: Pueblo (USA) Arvada (USA) Cape Coral (USA) Green Bay (USA) Santa Clara (USA) Beispiel #3 A mysqli_result example comparing iterator usage
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie: 'root'@'192.168.1.1' 'root'@'127.0.0.1' 'dude'@'localhost' 'lebowski'@'localhost' ================== 'root'@'192.168.1.1' 'root'@'127.0.0.1' 'dude'@'localhost' 'lebowski'@'localhost' Siehe auch
|