Google

NukeCoder


View next topic
View previous topic
Post new topic   Reply to topic
Author Message
floppy




Joined: Nov 29, 2006
Posts: 85
Location: Jackson, Mississippi

PostPosted: Tue Jan 02, 2007 2:06 am
Reply with quote

I am entering peoples birthday into the db through simple select boxes.

Then mktime etc etc.

This is the odd thing. Anything before 12/31/69 will not enter. Any idea's?

Code:
echo "<select name='birthyear'>";
echo "<option value=\"\">--------</option>";
        $i = date("Y")-99;
        $y = date("Y");
        while ($i <= $y) {
            $k = $i * 1;
            echo "<option value='$k'>$k</option>\n";
            $i++;
        }
echo "</select>";


Last edited by floppy on Tue Jan 02, 2007 2:15 am; edited 1 time in total 
View user's profile Send private message Visit poster's website MSN Messenger
floppy




Joined: Nov 29, 2006
Posts: 85
Location: Jackson, Mississippi

PostPosted: Tue Jan 02, 2007 2:11 am
Reply with quote

o and the column its going into is varchar(255) NULL
 
View user's profile Send private message Visit poster's website MSN Messenger
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 921

PostPosted: Tue Jan 02, 2007 2:35 am
Reply with quote

Yeah, there are some problems with storing birthdays in a timestamp, basically the timestamps start at 12/31/69 which is 0

I would suggest storing it as an actual m-d-y or even break the m,d,y into separate fields to make sorting easier...

The best option would be to use the Pear Date Class.
It might be a pain to figure out how to use it, but in the end it could help quite a bit.
 
View user's profile Send private message Visit poster's website
floppy




Joined: Nov 29, 2006
Posts: 85
Location: Jackson, Mississippi

PostPosted: Tue Jan 02, 2007 2:53 am
Reply with quote

As it is a package getting ready for distrobution which already requires GD and possibly zend optimizer(possibly). I am gonna try to go with m-d-Y. It will be a lot easier to manipulate into my birthday function as is.

http://www.t3gamingcommunity.com/modules.php?name=Clan_Roster

Thanks on the timestamp though, I was unaware of that.
 
View user's profile Send private message Visit poster's website MSN Messenger
floppy




Joined: Nov 29, 2006
Posts: 85
Location: Jackson, Mississippi

PostPosted: Tue Jan 02, 2007 3:10 am
Reply with quote

ack, the problem with that is then formatting the date out from the db. Crying or Very sad
 
View user's profile Send private message Visit poster's website MSN Messenger
floppy




Joined: Nov 29, 2006
Posts: 85
Location: Jackson, Mississippi

PostPosted: Tue Jan 02, 2007 3:45 am
Reply with quote

Ok got this worked out with some figgling. What ended up working the best for now is 3 seperate columns.

Thanks gotcha
 
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 5 Hours
Forums ©