/    Sign up×
Community /Pin to ProfileBookmark

hi,
how would i be able to insert the date into my database if i have 3 dropdown boxes wherein it contain the month,day & year. i know the basic of inserting data into my database but with this 3 dropdown box i don’t have any idea. after submitting, the data selected on these 3 boxes shall be in one field in my database with fieldname Date . any sample codes for this one?

any help will be appreciated.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@simpson97Oct 13.2004 — I would use strtotime()

http://us2.php.net/date

Bob
Copy linkTweet thisAlerts:
@Daot_LagorilleOct 13.2004 — Or just concatenate the three variables into one, which you will then use in your INSERT statement:


$month = $_GET['month'];

$day = $_
GET['day'];

$year = $_GET['year'];

$full_dte = $year."-".$month."-".$day;

Then use $full_dte as the variable in your insert statement....
Copy linkTweet thisAlerts:
@franchesauthorOct 14.2004 — thanks a lot guys.?
×

Success!

Help @franches spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...