proctk Posted October 15, 2006 Share Posted October 15, 2006 Hi I use the below function to calculate the years between two years. Everything works fine on my test server which uses mysql 5 and php 5 For some reason its not working on my web server, which uses verion 4.1php and 4.0.27 mysql. [code=php:0]<?function dateDiff($dformat, $endDate, $beginDate){ $date_parts1=explode($dformat, $beginDate); $date_parts2=explode($dformat, $endDate); $start_date=gregoriantojd($date_parts1[1], $date_parts1[2], $date_parts1[0]); $end_date=gregoriantojd($date_parts2[1], $date_parts2[2], $date_parts2[0]); return $end_date - $start_date;} ?>[/code]statement to ge the value [code=php:0]$age = round(dateDiff("-",date("Y-m-d", time()), $dob)/365, 0);[/code]my page stops once it hits this line of code. no error messages are given. I confirmed the error is with this because when I comment it out it works fineany help is grerwta Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.