[TYPO3-core] RFC: another enhancement to the DB connect method and error display in the FE
Martin Kutschker
martin.kutschker-n0spam at no5pam-blackbox.net
Tue Sep 25 11:26:04 CEST 2007
Dmitry Dulepov [typo3] schrieb:
> Martin Kutschker wrote:
>> Personally I don't like the get_lats_whatever() approach not very
>> much. I'm much more in favour of a return object/array style where the
>> results and status code etc are in properties. Of course this can't be
>> done here because of compatibiliyt. Which is the *only* reason the
>> parameter is optional.
>
> That getLastError() approach has another big plus. Currently there is no
> way to get error message in t3lib_db. There is a method sql_error but
> this is not truly the same and it does not provide error code for
> possible analysis and recovery.
I'm not convinced yet, but maybe you can find the time and make a
preliminary patch that implements the lastError thingy in a couple of
places.
> And actually, wouldn't TYPO3_DB->sql_error() return this error message
> if connection fails?
No, it doesn't. The Mysql lib ties the error to the connection. Sadly it
doesn't tie query errors to the result resource.
Masi
More information about the TYPO3-team-core
mailing list