Welcome Guest, Not a member yet? Register   Sign In
error in loading model in controller
#11

[eluser]smilie[/eluser]
Hold on,

is it modelname, Modelname or Model_name?

Cheers,
Smilie
#12

[eluser]praveena[/eluser]
Model_name is the model name
#13

[eluser]Cristian Gilè[/eluser]
Load the model as follow:

$this->load->model('Model_name');

and access the function with

$this->Model_name->insert($id);
#14

[eluser]smilie[/eluser]
Controller:

Code:
$this->load->model('Model_name');
$ss = $this->Model_name->insert($id);

Model:
Code:
Class Model_name extends Model {

   function insert($id)
   {
     ...
   }
}
#15

[eluser]praveena[/eluser]
HI

I did the same need to load any libraries

Regards
Praveena
#16

[eluser]InsiteFX[/eluser]
This also depends on if your using CI 1.7.X or CI 2.0.0 !

CI 1.7.X - Class Model_name extends Model {}

CI 2.0.0 - Class Model_name extends CI_Model {}

Also your Controller will be looking for an index function to
run as default.

Unless you post all the code to your Controller it will be hard to
help you.

Also use POST REPLY and the CODE TAGS!

InsiteFX
#17

[eluser]praveena[/eluser]
hi I am using CI 1.72

Class Model_name extends Model {}

I followed this only Still I am getting error
#18

[eluser]cideveloper[/eluser]
I know this is not helpful, but this is the funniest back and forth I have read in a while. I am almost inclined to think that praveena is trolling this thread.
#19

[eluser]praveena[/eluser]
hey I got this error for not closing the class properly I did its wirking now I am not trolling this thread progr@mmer
#20

[eluser]cideveloper[/eluser]
I'm glad its working now and that you figured out the problem but like InsiteFX said "Unless you post all the code to your Controller it will be hard to help you." The community is willing to help but this sounded like they were pulling teeth to just get you to post your controller and model code in full. The more information provided, the faster and better responses obtained.




Theme © iAndrew 2016 - Forum software by © MyBB