|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Adding Variables together
Alright im making a registration form for my website.. Users are asked enter there birthday... there is a dropdown menu with all the numbers from 1-31 to select there birthday, another dropdown with all the months from Jan. to Dec. to select there birthmonth and another dropdown to select there birthyear. Now the problem is it needs to be entered into the MySQL database in YYYY-MM-DD Format so I need to combine the variables into one string. I have $day, $month, and $year, so inorder to put it into the format i'd do $year-$month-$day but that would subtract them so i need a way where my string ($age) can be $year-$month-$day so it will look like 1989-02-02 and the database will accept it! Please Help, i've tryed all the ways i can think of to put the variables together into one string
|
|
#2
|
|||
|
|||
|
PhreakShow64,
The easiest way would be like so: PHP Code:
In PHP, the concatenation character is the period (.)... If you need any other help, just ask! Hope that helps!
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#3
|
|||
|
|||
|
Thanx a lot
|
|
#4
|
|||
|
|||
|
No problem! Welcome to DevArticles. Enjoy your stay!
Btw... Don't forget to "echo $myskill;" for your signature! :P (just kidding... I had to after seeing that! Made me laugh. )It'll come eventually... We all start as beginners... If you need help, don't hestitate to post in the forums! |
|
#5
|
|||
|
|||
|
New Problem
Now my registration form doesnt work, and i cannot figure out why, I made one before that worked and this one is based on that but it wont work! heres part of the code... I'm not getting a parse error, im gettin my error, Error adding user!
PHP Code:
|
|
#6
|
|||
|
|||
|
omg... i cant believe i just saw it!! a stupid little ; after $parent instead of a comma
|
|
#7
|
|||
|
|||
|
Hehehe... It's a common mistake! We all do it! At least you can change your signature now:
$myskill = not as pathetic; ![]() All is well? |
|
#8
|
|||
|
|||
|
Hows this signature??
|
|
#9
|
|||
|
|||
|
Perfect!
We'll update it as we go along! ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Adding Variables together |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|