Ich versuche, eine Ausnahme zu machen conection zu einer Datenbank zu überprüfen, aber ich bekomme immer wieder diese:Fatal error: abgefangene Ausnahme 'Exception' with message
(!) Fatal error: Uncaught exception 'Exception' with message 'Can't
Connect to DB' in C:\wamp64\www\Avanzado\MIUII\Login\conect.php on line 19
(!) Exception: Can't Connect to DB in
C:\wamp64\www\Avanzado\MIUII\Login\conect.php on line 19
Call Stack
# Time Memory Function Location
1 0.0005 244256 {main}() ...\login.php:0
2 0.0011 249256 include('C:\wamp64\www\Avanzado\MIUII\Login\conect.php'
) ...\login.php:13
Mein Code für diese Seite bisher:
<?php
[email protected]_connect("localhosta", "root", "");
[email protected]_select_db("login", $conexion);
if (!$conexion)
{
throw new Exception ('No se pudo establecer una conexion');
}
Was ist die PHP-Version? –
'localhosta' das ist ein Tippfehler, übrigens. Es sollte 'localhost' sein. –
5.6.25 ... Und ja, aber ich erzwinge den Fehler für Test –