GPWiki.org
GPWiki.org
It is currently Thu May 23, 2013 2:32 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Jan 26, 2008 4:07 am 
Level 22 Norse Warrior-Librarian

Joined: Sun Sep 05, 2004 4:59 am
Posts: 505
Location: Auckland, New Zealand
Ok I'm not an expert on php or databases or anything like that, but I'm working on the highscore recording for my game and I've got everything working except for the goddamn date.

I can save the date as a string (varchar) in the mySQL table, but I really want to save it as a type (date) so I can query it easier.

$date = getdate();

doesn't seem to work when I try insert $date into the table. Is there some silly format I have to use to get it into the table?

_________________
Attack of the Meeplings - Free 2D Arcade Shooter
Caverns of Underkeep - Free Browser Based Roguelike


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 26, 2008 9:39 am 
Level 22 Norse Warrior-Librarian

Joined: Sun Sep 05, 2004 4:59 am
Posts: 505
Location: Auckland, New Zealand
Yup, stupid formating thing

$today = getDate();
$today = date("Y-m-d");

_________________
Attack of the Meeplings - Free 2D Arcade Shooter
Caverns of Underkeep - Free Browser Based Roguelike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 27, 2008 6:54 pm 
Babirusa
User avatar

Joined: Thu Aug 19, 2004 2:55 pm
Posts: 9241
Location: The Netherlands
the timestamp field can have it's date set automatically using NOW(), no code needed.

_________________
Serious game developer

http://www.persistentrealities.com
http://www.persistentrealities.com/vbfibre
http://www.ambiances.nl


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group