0){ $accountAgeNumber = $this->accountAge( $_SESSION['member_id'] ); // echo $accountAgeNumber." -----"; //exit; $retArr['returnPage'] ='dash'; if ($accountAgeNumber < 60 ){ $retArr['returnPage'] ='dash/help'; } } return $retArr; } private function accountAge($member_id){ $accAge = 10000000; $ageQ = "SELECT ((DATE_PART('day', now()::timestamp - added::timestamp) * 24 + DATE_PART('hour', now()::timestamp - added::timestamp)) * 60 + DATE_PART('minute', now()::timestamp - added::timestamp)) * 60 + DATE_PART('second', now()::timestamp - added::timestamp) AS accage FROM members WHERE id =".$member_id; $query = $this->db->query($ageQ); $row = $query->row(); if (isset($row)) { $accAge = $row->accage; } return $accAge; } }