General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old June 8th, 2003, 07:17 PM
browneye browneye is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 4 browneye User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post DATETIME Question

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!

Reply With Quote
  #2  
Old June 8th, 2003, 10:43 PM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 364 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6
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

Reply With Quote
  #3  
Old June 8th, 2003, 11:53 PM
browneye browneye is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 4 browneye User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old June 9th, 2003, 12:02 AM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 364 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > DATETIME Question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway