This is a discussion on "sorry, need more help with time" within the PHP Forum section. This forum, and the thread "sorry, need more help with time are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
sorry, need more help with time
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
||||
|
||||
|
sorry, need more help with time
i was kindly helped with a problem with my date this morning, but i have been trying to figure out this
this is the date format i want, Quote:
Quote:
its fine at form its fine at database i just need to change the format once it is called from the database and printed on the page form.php
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
Last edited by saltedm8; Oct 6th, 2007 at 16:24. |
|
|
|
#2
|
|||
|
|||
|
Re: sorry, need more help with time
Have you selected the date format for example:
SELECT *, DATE_FORMAT(date,'%D %M %Y') as fdate FROM form Using the formated date http://www.plus2net.com/php_tutorial...ate_format.php |
|
#3
|
||||
|
||||
|
Re: sorry, need more help with time
which one would i need to put it into and where, i have tryed doing it but failed
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
|
|
#4
|
|||
|
|||
|
Re: sorry, need more help with time
This is what I use
Last edited by AdRock; Oct 6th, 2007 at 20:17. |
|
#5
|
||||
|
||||
|
Re: sorry, need more help with time
i must be putting it in the wrong place or pages, i just cant figure out where this needs to be
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
|
|
#6
|
|||
|
|||
|
Re: sorry, need more help with time
Quote:
When you perform the query to select the record and use use SELECT * FROM wherever, you need to select all the fileds in the database that are being selected instead of using * and the field that has the date, you then use DATE_FORMAT(eventdate, '%W %D %M %Y') as date |
|
#7
|
|||
|
|||
|
Re: sorry, need more help with time
Quote:
Take it away AdRock I'll leave it in your hands |
|
#8
|
||||
|
||||
|
Re: sorry, need more help with time
Quote:
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
Last edited by saltedm8; Oct 6th, 2007 at 20:35. |
|
#9
|
|||
|
|||
|
Re: sorry, need more help with time
In my example have you changed the eventdate to the correct date field in your database?
|
|
#10
|
|||
|
|||
|
Re: sorry, need more help with time
On Line 19 in main.php
replace $sql = "SELECT * FROM form With $sql = "SELECT *, DATE_FORMAT(date,'%D %M %Y') as fdate FROM form And line 24 with print $row->fdate ; Well thats my 2cent anyway |
|
#11
|
|||
|
|||
|
Re: sorry, need more help with time
This is my query
and this is how i display the result
|
|
#12
|
||||
|
||||
|
Re: sorry, need more help with time
Change this line
Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#13
|
||||
|
||||
|
Re: sorry, need more help with time
thank you all for your help, but once again Rakuli cracked it, thanks mate - appresiate everyones help
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
|
![]() |
| Thread Tools | |
|