CodeIgniter Forums
can not redeclare function quote error in model - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: can not redeclare function quote error in model (/showthread.php?tid=52849)



can not redeclare function quote error in model - El Forum - 06-29-2012

[eluser]Ram Krishna[/eluser]
My model code is
Code:
<?php
class Quote extends CI_Model
  {
    function insert_quote($file_name)
     {
       $data=array('ready'=>$this->input->post('ready'),'aim1'=>$this->input->post('aim1'),'aim2'=>$this->input->post('aim2'),'aim3'=>$this->input->post('aim3'),'aim4'=>$this->input->post('aim4'),'aim5'=>$this->input->post('aim5'),'aim6'=>$this->input->post('aim6'),'aim7'=>$this->input->post('aim7'),'aim8'=>$this->input->post('aim8'),'project_type'=>$this->input->post('project_type'),'feature1'=>$this->input->post('feature1'),'feature2'=>$this->input->post('feature2'),'feature3'=>$this->input->post('feature3'),'feature4'=>$this->input->post('feature4'),'feature5'=>$this->input->post('feature5'),'feature6'=>$this->input->post('feature6'),'feature7'=>$this->input->post('feature7'),'feature8'=>$this->input->post('feature8'),'feature9'=>$this->input->post('feature9'),'company'=>$this->input->post('company'),'similar_site'=>$this->input->post('similar_site'),'file_name'=>$file_name,'contact_name'=>$this->input->post('contact_name'),'email'=>$this->input->post('email'),'country'=>$this->input->post('country'),'city'=>$this->input->post('city'),'phone'=>$this->input->post('phone'),'skype_id'=>$this->input->post('skype'),'gtalk_id'=>$this->input->post('gtalk'),'contact_mthd'=>$this->input->post('contact_mthd'),'request_status'=>'0','address'=>$this->input->post('address'));
$query=$this->db->insert('request_quote',$data);
$this->db->query($query);
     }
} ?>
when i am calling the function this is giving error-

Fatal error: Cannot redeclare class Quote in /opt/lampp/htdocs/crm/application/models/quote.php on line 10
please help me?
thanks in advance.



can not redeclare function quote error in model - El Forum - 06-29-2012

[eluser]LuckyFella73[/eluser]
Is the name of your controller class "quote" too?
Renaming the model class to Quote_model would solve
the problem then I guess.


can not redeclare function quote error in model - El Forum - 06-29-2012

[eluser]weblyan[/eluser]
What the error is saying is that there is another class somewhere that is also named Quote. I don't think it is a Codeigniter class. It is probably in you application somewhere or you are somehow including that file twice.