/    Sign up×
Community /Pin to ProfileBookmark

1 database field? or 3? for a birthday html form

Hi again, I “acquired” this Date of birth HTML form and would like to use it. Problem is I don’t understand whether I need to make 3 separate fields in my database(month, day, year)? Or just 1?

I can code the PHP for using three fields for it, but just wondering if it could be simplified down to one.

Could this be done using only one field in Mysql? If it is possible, I would definitely need help coding the 3 Birthday values to tie them together to then enter into the database. I would like to display my peep’s birthday like so: (11/08/1974)

The form has 3 drop-downs, month, day, year. Names that php would receive from these are: (birthmonth, birthday, birthyear)

Thanks for any responses?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@pcthugJan 22.2007 — [code=php]
@mysql_query(sprintf("INSERT INTO birthdays SET date = '%d/%d/%d'", $birthmonth, $birthday, $birthyear));[/code]
Copy linkTweet thisAlerts:
@_blurico_Jan 22.2007 — Someone has already mentioned this problem before, check out the foolowing thread. You should find your answer there. Cheers ?

User: oo7ml


Thread Name: DOB - where am i going wrong
Copy linkTweet thisAlerts:
@WebjedikungfuauthorJan 22.2007 — Thanks you guys, PCThug's post did it?
Copy linkTweet thisAlerts:
@WebjedikungfuauthorJan 22.2007 — What does the @ symbol do before your query there?
Copy linkTweet thisAlerts:
@pcthugJan 22.2007 — Suppress any errors that may be triggered by the mysql_query function, primarily for security purposes.
×

Success!

Help @Webjedikungfu 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 6.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...