• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parse error: syntax error, unexpected T_AS in C:\wamp\www\Adreach\application\models\offerModel.php on line 13

#1
[eluser]bsrbvr[/eluser]
Hi, I am getting above parse error on line 13 when executing this query. Is any other way to perform mathematical operations in codeigniter?

Code:
public function get_nearestOffers($slug1,$slug2)
{  
  $this->db->select('*');
  $query = $this->db->get_where('adp_city_list', array('city_name' => $slug1 ));
  $resultdata = $query->row_array();

  $this->db->select('area_latitude,area_longitude');
  $query1 = $this->db->get_where('adp_area_list', array('city_id' => $resultdata['city_id'] , 'area_name' => $slug2 ));
  $data = $query1->row_array();


  $this->db->select('loc.location_id',( 3959 * acos( cos( radians($data['area_latitude']) ) *cos( radians( loc.location_lat ) ) * cos( radians( loc.location_long ) - radians($data['area_longitude']) ) +sin( radians($data['area_latitude']) ) * sin( radians( loc.location_lat ) ))) AS distance);
  $this->db->from('adp_location as loc');
  $this->db->having('distance < 8');
  $this->db->order_by("distance");  
  $resultdata = $this->db->get();  
  print_r($resultdata->result());
  return $resultdata->result();
}

Thanks


Messages In This Thread
Parse error: syntax error, unexpected T_AS in C:\wamp\www\Adreach\application\models\offerModel.php on line 13 - by El Forum - 03-03-2012, 04:25 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.