How to load mysql data on separate forms


Problem :

I used this code to add the data in the mysql table. But I do not know how to separate them because they are only stored in one column:

$birthday = mysql_real_escape_string($_POST['yyyy'] . '-' . $_POST['mm'] . '-' . $_POST['dd']); 

How do I load them in here, so that the month, day, and year will be separated:

<tr>
<td><font size="2">Birthday</td>
<td>
 <select title="- Select Month -" name="mm" id="mm" class="" > 
                              <option value=""  >--Month--</option> 
                              <option value="1" >Jan</option> 
                              <option value="2"  >Feb</option> 
                              <option value="3"  >Mar</option> 
                              <option value="4"  >Apr</option> 
                              <option value="5"  >May</option> 
                              <option value="6"  >Jun</option> 
                              <option value="7"  >Jul</option> 
                              <option value="8"  >Aug</option> 
                              <option value="9"  >Sep</option> 
                              <option value="10"  >Oct</option> 
                              <option value="11"  >Nov</option> 
                              <option value="12"  >Dec</option> 
                              </select> 
                      <input title="Day" type="text" onkeypress="return isNumberKey(event)" name="dd" value="" size="1" maxlength="2" id='numbers'/ > 
                      <input title="Year" type="text" onkeypress="return isNumberKey(event)" name="yyyy"  value="" size="1"  maxlength="4" id='numbers'/> </td>
    </tr>

Please help.



Solution :

Are you asking separate in mysql right?

For Year

SELECT EXTRACT(YEAR FROM '1999-07-02');

Output is 1999

For Month

SELECT EXTRACT(MONTH FROM '1999-07-02');

Output is 7

For Day

SELECT EXTRACT(DAY FROM '1999-07-02');

Output is 2

Is it ok ?


Mysql Tutorials

Mysql Howto..

How to Dump Mysql database using Command line?

How do I select data from a select query in MySql?

How do I set a number for each row according to two other columns in one MySQL query?

How to retrieve result set from MySQL case query in PHP

How to fix Incorrect string value when trying to convert from Latin1 to UTF8 error in mysql?

MySql How to set root password to null

how to increase a field value of mysql table every some minutes automatically

Rails / PHP : How to serialize an sql data row?

how to update one or more fields ignoring the empty fields into mysql database?

MySQL : how to find nearest polygon from a special point in mysql versions above 5.6.1?

How speed up program? (Lot of slow mysql queries)

How to select non-empty columns in MySQL?

How to sort in MySQL

How do I use more “select query” with Mysql to get result from different table

How would I populate an Android Spinner with data from a MySQL Database? [closed]

How to check which scheduled program runs every day in windows 7?

How to migrate data from FoxPro to MySQL

how to get orphans from a join table in mysql

How to connect to MySQL server from C# / C++ application?

How to get particular date in mysql?

How to make a MySQL generated table interactive PHP

How to bind dates and other variables to php sql query? (MySql)

how to store retrieved data to temporary table with mysql

How to Make MySQL join with same values in another table

How to know if you are on the first record in a PHP/MySQL mysql_fetch_array()

How to insert to second table with DISTINCT in MySQL?

How to find root cause for “too many connections” error in MySQL/PHP

How to Store Multidimensional Array in Mysql Using PHP

MYSQL: How can I create a MySQL table so, that a field's default value is the output of a function

How to Subtract Time in MySQL