|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I'm developing my on PHP/MySQL guestbook. I have set up an insertion page to add the user's post's to the table, and then another page to view the results. They are working just fine, but I want to sort them by the date and time in which they were posted from newest to oldest. I've read through my php book and it mentions the "now()" function. Here is what I have so far, can someone lend me a hand. I made the DATETIME function hidden as I want it to be supplied by the server.
<input type="hidden" name="date" value="<?php now() ?>"> <input type="hidden" name="display" value=""> <input type="hidden" name="MM_insert" value="form1"> </form> is that the correct way to get it to input the time? Thanks in advance for any help given! |
|
#2
|
|||
|
|||
|
well 1 problem with this
Code:
<input type="hidden" name="date" value="<?php now() ?>"> is that your not supplying the exact insertion time. That form field gets set when the page loads. so if someone leaves a browser window open on that page, then comes back to it 5 hours later, that form date field will still be set. see what I mean?
__________________
-- Jason |
|
#3
|
|||
|
|||
|
Update
I changed it from being part of the form to being part of the insert command. It is now pulling the current time when the submit button is pressed so I believe that should work, well atleast it seems to be working like I want it to work. Thanks for your tip though.
|
|
#4
|
|||
|
|||
![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > DATETIME Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|