Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.php > #4365

Warum keine Fehlermeldung?

From Jan Novak <repcom@gmail.com>
Newsgroups de.comp.lang.php
Subject Warum keine Fehlermeldung?
Date 2018-05-02 15:28 +0200
Organization albasani.net
Message-ID <pccee9$tpq$1@news.albasani.net> (permalink)

Show all headers | View raw


Hallo,


Ich habe folgenden php Code:

public function executeSQL($sql) {
   	try {
           $stmt = $this->pdo->exec($sql);
    	  $lid= $this->pdo->lastInsertId();
        } catch (PDOException $pe) {
     	echo 'PDO ERROR: ' . $pe->getMessage() . '<br>SQL String: <b>' . 
$sql."</b>";
     	die();
     } catch (Exception $e) {
       echo 'ERROR: ' . $e->getMessage() . '<br>SQL String: <b>' . 
$sql."</b>";
       die();
     }
     return $lid;
   }

Wenn ich nun einen Fehlerhaften "create Table ..." auf die Datenbank los 
lasse, bleibt das Programm weder im PDOException noch im Exception Fall 
stehen.

Wohin gegen ein fehlerhafter "select"  Befehl mit einer Exception 
quittiert wird.

Jan

Back to de.comp.lang.php | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Warum keine Fehlermeldung? Jan Novak <repcom@gmail.com> - 2018-05-02 15:28 +0200
  Re: Warum keine Fehlermeldung? Claus Reibenstein <4spamersonly@kabelmail.de> - 2018-05-03 16:22 +0200
    Re: Warum keine Fehlermeldung? Jan Novak <repcom@gmail.com> - 2018-05-04 07:45 +0200
      Re: Warum keine Fehlermeldung? k@rl.pflaesterer.de (Karl Pflästerer) - 2018-05-04 09:19 +0200
        Re: Warum keine Fehlermeldung? Jan Novak <repcom@gmail.com> - 2018-05-04 13:00 +0200

csiph-web