Model help noob |
[eluser]dmisterct[/eluser]
I just started developing with models and I need help with the insert portion, I have a Model something along Code: <?php and a Controller like: Code: <?php I used error_logging and I found that the Code: $this->db->insert('table', $this);
[eluser]solid9[/eluser]
not test but try this, Code: <?php
[eluser]dmisterct[/eluser]
If it helps here is the software stack on my OS PHP 5.3.3 CentOS not sure which version.
[eluser]InsiteFX[/eluser]
Insert expects and associate array or a class object! Code: public function insert_entry($field1, $field3)
[eluser]dmisterct[/eluser]
I'm just wondering, this database and the tables already existed. I'm actually trying to take an existing application and convert it into a CodeIgniter based application. Does having an existing database with certain existing fields prevent CodeIgniter's data models to combine? So for example from a mysql vardump I get the previously created table which I am trying to model: Code: CREATE TABLE `table` { Also @ InsiteFX, I thought that Code: $this I did try using an associate array and it does not work. I can only assume my problem has to deal with the database itself. I am hoping if anyone could give some insight as to whether or not adding to an existing database with an existing schema affects how I should insert using CodeIgniter's data models.
[eluser]dmisterct[/eluser]
Ok I figured out what was wrong, I misspelled one of the field names. It was such a small typo. |
Welcome Guest, Not a member yet? Register Sign In |