mysqli::$connect_errno

mysqli_connect_errno

(PHP 5, PHP 7, PHP 8)

mysqli::$connect_errno -- mysqli_connect_errnoReturns the error code from last connect call

Beschreibung

Objektorientierter Stil

Prozeduraler Stil

mysqli_connect_errno(): int

Returns the error code from the last connection attempt.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

An error code for the last connection attempt, if it failed. Zero means no error occurred.

Beispiele

Beispiel #1 $mysqli->connect_errno example

Objektorientierter Stil

<?php

mysqli_report
(MYSQLI_REPORT_OFF);
/* @ is used to suppress warnings */
$mysqli = @new mysqli('localhost''fake_user''wrong_password''does_not_exist');
if (
$mysqli->connect_errno) {
    
/* Use your preferred error logging method here */
    
error_log('Connection error: ' $mysqli->connect_errno);
}

Prozeduraler Stil

<?php

mysqli_report
(MYSQLI_REPORT_OFF);
/* @ is used to suppress warnings */
$link = @mysqli_connect('localhost''fake_user''wrong_password''does_not_exist');
if (!
$link) {
    
/* Use your preferred error logging method here */
    
error_log('Connection error: ' mysqli_connect_errno());
}

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

Pharmaqo Labs

Discover Pharmaqo Labs (https://pharmaqolabs.us/), your trusted online store for injectables, orals, HGH, peptides, and SARMs. Shop high-quality p ...

Geschrieben von wycnik77 am 01.06.2026 14:16:07
Forum: Ankündigungen
Zypharix Labs | Buy Viagra, Tadalafil & Dapoxetine – Men’s ************ual Supplements

Zypharix Labs (https://zypharixlabs.us/) offers Viagra, Tadalafil & Dapoxetine online. Affordable prices, discreet delivery & guaranteed quality f ...

Geschrieben von tinhish am 01.06.2026 13:34:27
Forum: Ankündigungen
Pharmaqo | Buy Tirzepatide & Semaglutide – Trusted Peptides Products

Explore high-quality buy tirzepatide online (https://tirzepatide.to/), semaglutide, retatrutide and peptide products at PharmaQO Labs. Get detaile ...

Geschrieben von bzo0ham am 01.06.2026 12:49:12
Forum: Ankündigungen
Pharmaqo Labs | Safe Anabolic & Performance Support

Pharmaqo Labs (https://pharmaqolabs.store/) is a trusted provider of high-quality anabolic steroids, peptides, and performance-enhancing supplemen ...

Geschrieben von iletneils am 01.06.2026 11:59:55
Forum: Ankündigungen