Jump to content

combing data and inserting into db


harkly

Recommended Posts

I am trying to combine a date. The user inputs a day, month and a year separately. I want to combine them and insert into the data base. I know how to combine but not sure where I should put the code?? page1 or page2

 

page1 has the form and page2 updates the database

right now I have the

 

 

 

  mysql_select_db('test');

 

  $bd_day=$_POST["bd_day"];

  $bd_month=$_POST["bd_month"];

  $bd_year=$_POST["bd_year"];

  $birth_date=$_POST["birth_date"];

 

$sql = "INSERT INTO user

(bd_day, bd_month, bd_year, birth_date)

  VALUES

('$_POST[bd_day]','$_POST[bd_month]','$_POST[bd_year]','$_POST[birth_date]',NOW())";

Link to comment
https://forums.phpfreaks.com/topic/188528-combing-data-and-inserting-into-db/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.