Date Not Saving in Mysql from Php Registration Form

前端 未结 4 1374
别跟我提以往
别跟我提以往 2021-01-29 08:46

I am having trouble saving the date of birth in Mysql Db from Php registration form, what am I doing wrong?

  1. Check.php

    $month = $_POST[\'month\'];
4条回答
  •  一个人的身影
    2021-01-29 08:58

    You are doing wrong in concating in mysql query.

    $FirstName + "','" 
    

    above is wrong.

    use it as below.

    '". $FirstName ."',
    

    Edit

    $date = $year."-".$Month."-".$Day;
    
    INSERT INTO users 
        (FirstName,LastName,Phone,DOB)
    VALUES
    ( '". $FirstName ."','". $LastName ."','". $Phone ."','". $date ."')
    

提交回复
热议问题