mysqli::$info

mysqli_info

(PHP 5, PHP 7, PHP 8)

mysqli::$info -- mysqli_infoRetrieves information about the most recently executed query

Beschreibung

Objektorientierter Stil

?string $mysqli->info;

Prozeduraler Stil

mysqli_info(mysqli $mysql): ?string

The mysqli_info() function returns a string providing information about the last query executed. The nature of this string is provided below:

Possible mysqli_info return values
Query type Example result string
INSERT INTO...SELECT... Records: 100 Duplicates: 0 Warnings: 0
INSERT INTO...VALUES (...),(...),(...) Records: 3 Duplicates: 0 Warnings: 0
LOAD DATA INFILE ... Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
ALTER TABLE ... Records: 3 Duplicates: 0 Warnings: 0
UPDATE ... Rows matched: 40 Changed: 40 Warnings: 0

Hinweis:

Queries which do not fall into one of the preceding formats are not supported. In these situations, mysqli_info() will return an empty string.

Parameter-Liste

mysql

Nur bei prozeduralem Aufruf: Ein von mysqli_connect() oder mysqli_init() zurückgegebenes mysqli-Objekt.

Rückgabewerte

A character string representing additional information about the most recently executed query.

Beispiele

Beispiel #1 $mysqli->info example

Objektorientierter Stil

<?php
$mysqli 
= new mysqli("localhost""my_user""my_password""world");

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

$mysqli->query("CREATE TEMPORARY TABLE t1 LIKE City");

/* INSERT INTO ... SELECT */
$mysqli->query("INSERT INTO t1 SELECT * FROM City ORDER BY ID LIMIT 150");
printf("%s\n"$mysqli->info);

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

Prozeduraler Stil

<?php
$link 
mysqli_connect("localhost""my_user""my_password""world");

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

mysqli_query($link"CREATE TEMPORARY TABLE t1 LIKE City");

/* INSERT INTO ... SELECT */
mysqli_query($link"INSERT INTO t1 SELECT * FROM City ORDER BY ID LIMIT 150");
printf("%s\n"mysqli_info($link));

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

Die obigen Bespiele erzeugen folgende Ausgabe:

Records: 150  Duplicates: 0  Warnings: 0

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

The Ultimate Guide to Writing a Synthesis Essay

Writing a synthesis essay requires combining information from multiple sources to create a clear and well-supported argument. If you are wondering ...

Geschrieben von xokeg33032 am 10.03.2026 12:07:48
Forum: PHP Developer Forum
F1 Managerspiel sucht PHP Programmierer

Wow, endlich viele Details zum Projekt! Manchmal könnte man ein paar praktische Beispiele hinzufügen, damit es für Anfänger verständlicher is ...

Geschrieben von suchedich am 09.03.2026 14:13:54
Forum: Projekthilfe
SEO-URLs und MySQL

SEO-URLs verbessern sowohl die Sichtbarkeit bei der Suche als auch das Vertrauen der Benutzer, während MySQL eine strukturierte Speicherung und e ...

Geschrieben von chavesarlene am 04.03.2026 20:48:58
Forum: SQL / Datenbanken
SEO-URLs und MySQL

Doofe Frage, aber werden die Zielseiten denn generiert und in der Verzeichnisstruktur abgelegt? Bei mir hab ich es so gemacht, dass per htaccess 4 ...

Geschrieben von Weindesigner am 27.02.2026 19:53:31
Forum: SQL / Datenbanken