Calculate age php MVC

0

Notice: Undefined index: difference in D: \ wamp \ www \ project \ model \ modelpersona.php on line 30

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE [23000]: Integrity constraint violation: 1048 Column' difference 'can not be null' in D: \ wamp \ www \ project \ model \ modelpersona.php on line 35

I need to calculate the age with the date of birth in MVC

    
asked by Andres Ramos 11.11.2017 в 19:20
source

1 answer

0

There is no $_POST['diferencia'] in your Persona model.

  

Notice: Undefined index: difference in D: \ wamp \ www \ project \ model \ modelpersona.php on line 30

The column differs from your table atencion_cliente does not accept nulls.

  

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE [23000]: Integrity constraint violation: 1048 Column' difference 'can not be null' in D: \ wamp \ www \ project \ model \ modelpersona.php on line 35

The errors are clear.

Check that you get the property diferencia in your POST and in principle everything will work for you, I do not see it in your example of the form you send.

    
answered by 11.11.2017 в 19:30