php - Automatically format sql dates -


What am I trying to do, without any dates in your SQL queries (PHP / Oracle).

I am using to_char (pi.date_of_birth, 'YYYY / MM / DD') as date_of_birth to change the formatting of my questions. What I want to be able to do is apply it on any date returned by the '*' operator.

My problem is that I interrogate all of my hands, most of them are dynamically generated, and globally, changing the format in any way can be very easy.

The problem is now that there is 'zero' control on the database, so I can not go in and change anything or add a process. Is there some syntax, can I add my questions, or is it an easy way to integrate into PHP? Thank you.

Why do you need to format the output exactly in the database layer? Why does not it use PHP for date and time, and format it there? Similarly for input values, you should use parameterized queries and specify the value as a date / time rather than inserting it into a specific format in SQL.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -