|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-04 02:12 UTC] thad at bronto dot com
[2006-05-08 16:38 UTC] tgross at m-s dot de
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
Description: ------------ When calling PDO::query(), PHP crashes Apache on certain queries if the SQL-query contains errors. In the example, Query 1 is correct. Query 2 is wrong, and the exception is thrown (which is expected). Query 3 causes Apache to crash. Reproduce code: --------------- $dbh = new PDO ('odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:/path/to/database/db.mdb', '', ''); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); try { //$result = $dbh->query('select * from aktuelles'); // Query 1: Correct //$result = $dbh->query('select * from aktuellesX'); // Query 2: Wrong (Table aktuellesX does not exist) $result = $dbh->query('selectX * from aktuelles'); // Query 3: Wrong (Command selectX does not exist) $ret = $result->fetchAll(PDO::FETCH_ASSOC); } catch (Exception $e) { echo "Failed: " , $e->getMessage(); } Expected result: ---------------- PHP throws an exception and displays the error message. Actual result: -------------- Apache crashes.