hey guys i have a code here that should display the age of the client base on the birthday he input in the database.
here is the code:
[php]
<? require_once 'library/config.php'; if(isset($_SESSION['login_user']) && $_SESSION['login_user'] == 'ok'){ $user = $_SESSION['login_name']; $sql = "SELECT * FROM tbl_customer WHERE Username = '$user'"; $result = dbQuery($sql); $row = dbFetchAssoc($result); extract($row); $now = mktime(); $timeofbirth = mktime(0,0,0,$BDay); $Age = $now - $timeofbirth; $Age2 = $Age /(60*60*24*365.25); ?><?php require_once 'include/top.php';?> |
<?php require_once 'include/mainmenu.php';?> |
MY ACCOUNT PROFILE | |
First Name | |
Last Name |
[/php]
it displays this error:
Notice: A non well formed numeric value encountered in C:Program FilesxamppxampphtdocsieccTESTprojviewprofile.php on line 17
i’m still testing on localhost…
and the age it displayed is this:
37.6798795853
the birthdate is:
1987-12-08
someone please help!