Re: Datetime fields return value in different format?
Hi Steve,
Thank you for answering.
> You may need to do some coercion of the date data in your select query
> from MySQL as the DBGrid in particular relies upon string data and has no
> autoconversion of datatypes. The Datetime picker can have a multitude of
> datetime formats which are set as a property. I recommend you trackl down
> the source code or rather the documentation for that control from the
> original developer. The PDF doc does not come with the VCL for PHP.
I have used the value property in the JS. If I select a date the
DateTimePicker schows it correctly, thus the format setting is OK. Also the
datavieweer shows the date values correct. Thus the DB data format set is
OK. I set e.g. '22.06.2009' and after saving I get '22-06-2009' in the
controls only, not in the dataviewer, there I get '22.06.2009'. The OS data
format is set to '22.06.2009'.
> Conversely when saving the data you may have to cast the data or format
> the date data but this depends entirely on whether you are using tables
> views or stored procedures to update the data.
In the SQLs I just use the PHP-variable with quotes around and escaped. I
use the same SQL in SQL-scripts to preload the tables and it's working.
Therfore I guess it has to do with the date format changed by some process
during saving. I'm not very expert configuring MySQL.
> If you need to debug SQL issues like failed updates and incorrect
> parameters or mangled SQL and you dont have a SQL monitor like Toad for
> MySQL then turn on debuging in the Database component property "Debug". I
> doubt Firebug will help you.
I have set it and I'll try.
> These kinds of value/property issues should be readily solvable by setting
> breakpoints in the PHP debugger when you are making assignments to and
> from the control display value. Have you not tried that approach?
Unfortunately I use JS eventhandlers with ajax-calls to handle data. It's
faster. Besides, if setting breakpoints, the process slows down until
timeout many times or just not to load any more (worse with Firefox, some
better with IE).
John
|