Tech Reviews, Guides, Articles, and Forums for PC Hardware, Modding, and Gaming Enthusiasts
Fury-Tech Forums

Go Back   Fury-Tech Forums > Software Forums > Graphics, Web Design, CSS & Scripting
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

New to Fury-Tech Forums? Register now for free!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-27-2006, 11:28 AM
freshtokyo's Avatar
Great Diviner
Great Diviner
 
Join Date: Nov 2003
Location: In Maine
Posts: 1,638
Rep Power: 7
freshtokyo is on a distinguished road
Send a message via AIM to freshtokyo
Default Inserting a date

Hey there fellas, I'm trying to set up a small website for myself that has the date (simple j,n,Y) of when I'm dj'ing, I built a little admin for it.

I have three input text boxes:
Code:
<?PHP
   $ThisYear = date("Y");
?>
Date: <input name="LineupMonth" type="text" size="2" maxlength="2"> / 
<input name="LineupDay" type="text" size="2" maxlength="2"> / 
<input name="LineupYear" type="text" size="4" maxlength="4" value="<? echo $ThisYear; ?>">
what I can't figure out is how (when inserting into the database) to make date (j,n,Y) equal the dates I've set.

I want to do this because I'd like to not worry about going in and manually removing the dates that have passed. You know? (I'll set up a little code to only display dates that equal today or in the future) Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-27-2006, 03:03 PM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,803
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default

If you are using MySQL, the insert string would be something like this:

Code:
INSERT INTO table (lineupdate) VALUES ('2006-08-27');
The date needs to be year, month, day. Concatenate the values from the form with php before inserting into the db.

Something like:
Code:
$lineupdate = $year . '-' . $month . '-' . $day;
or in other words
Code:
$lineupdate = $_POST['LineupYear'] . '-' . $_POST['LineupMonth'] . '-' . $_POST['LineupDay'];
Assuming you're using post for the form.

Then put the lineupdate variable in your sql string:
Code:
$sqlstring = "INSERT INTO table ('lineupdate') VALUES ('" . $lineupdate . "');"
Something like that. That's one way anyway.
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Viewing
Go Back   Fury-Tech Forums > Software Forums > Graphics, Web Design, CSS & Scripting


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mac OS X 10.4 "Tiger" Release Date Announced freshtokyo Operating Systems 5 04-13-2005 11:54 AM
Grabbing date and time in a perl script... Technophile Programming and Coding 5 06-01-2004 05:17 PM
The date, the time, what what the time Tekime Jibber Jabber 1 07-24-2003 03:56 PM
Incorrect date? Technophile Site Feedback & Questions 13 07-24-2003 01:55 AM


All times are GMT -5. The time now is 02:06 AM.


PHP Scripts
BidVerve Directory
PageRank Script
SEO Scripts
37 SEO Scripts
List Cleaner Script
Keyword Cleaner
Directory Script
Directory Script

Directories
BidVerve Directory
BidVerve Directory
Nerve Directories
Nerve Directories
Directory Grow
Directory Grow

Our Supporters
entertainment sites
online casino

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0 ©2007, Crawlability, Inc.