You are here: Re: PDOException : get the bad query with exception handler « PHP Programming Language « IT news, forums, messages
Re: PDOException : get the bad query with exception handler

Posted by Toby A Inkster on 02/19/07 12:58

Tonio wrote:

> I got and an exception handler, and I want, for each PDOException
> throwned, to get the whole query which didn't works.

Not from the exception itself, no.

$exception->errorInfo[2] has some useful info, but its contents are
engine-specific, so may or may not contain the original SQL query
that triggered the error.

Why do you want to know the offending SQL query anyway? If you report
it back to the user, it could reveal a vulnerability in your code,
which could be used by a malicious user as a weak point to break into.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация