| | |
UK date insertion into mysql db problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Sep 2009
Posts: 7
Reputation:
Solved Threads: 0
Hi,
I have the following dates, either:
- 07-09-09 (which is 7th September 2009)
or
- 07/09/2009 (which is again 7th September 2009)
I need to reformat whichever one of these formats comes up so it
is correctly inserted into myql db via php.
Have tried strpos to find - or / and conditionals to create array of m,y,d and then rejoin in US format in order to use strtotime and then reformat via date into Y-m-d for database.... but that kept crashing the script...i'm a novice so any ideas?
Thanks in advance.
I have the following dates, either:
- 07-09-09 (which is 7th September 2009)
or
- 07/09/2009 (which is again 7th September 2009)
I need to reformat whichever one of these formats comes up so it
is correctly inserted into myql db via php.
Have tried strpos to find - or / and conditionals to create array of m,y,d and then rejoin in US format in order to use strtotime and then reformat via date into Y-m-d for database.... but that kept crashing the script...i'm a novice so any ideas?
Thanks in advance.
dont store a text format date, store a timestamp
timestamp can output to any user's preference
takes only 10bytes to store date and time,
is easier to process for select from - to dates
timestamp can output to any user's preference
takes only 10bytes to store date and time,
is easier to process for select from - to dates
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
![]() |
Similar Threads
- VB6 and mysql problem in filtering dates (Visual Basic 4 / 5 / 6)
- mysql problem (MySQL)
- Problem getting data back from MySQL DB (PHP)
- I am New In MySQL. Problem With MySQL Database Plz Help. (MySQL)
- Inserting date in format DD-MM-YYYY in MySQL (MySQL)
- Date Field in MySQL with PHP /add/edit/delete (PHP)
- about VC+MySQL problem:) (C)
- php mysql problem (PHP)
- MySQL, SQL conglutinate date items (MySQL)
Other Threads in the PHP Forum
- Previous Thread: Parse error
- Next Thread: mobile redirect
| Thread Tools | Search this Thread |
.htaccess ajax apache api array back basic beginner binary broken cakephp checkbox class cms code computing cron curl customizableitems database date delete display dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validation validator variable video web xml youtube






