Welcome Guest, Not a member yet? Register   Sign In
Updating field to database issue
#1

[eluser]Unknown[/eluser]
Hello all,

I recently started using image crud within the codeIgniter framework (http://www.grocerycrud.com/image-crud) and I love it. However, I want to add an description field to my images.

I managed to add the field and to load the current description from the database. But for some reason it doesn't update the description when you add or change it.

I only changed the default imagecrud files.

Live example: http://www.creations...ples/frontpage/


working:
Code:
Insert title:
    protected function _insert_title($primary_key, $value)
    {
  $this->ci->db->update($this->table_name, array($this->title_field => $value), array($this->primary_key => $primary_key));
    }

Not working:
Code:
protected function _insert_description($primary_key, $value)
    {
  $this->ci->db->update($this->table_name, array($this->description_field => $value), array($this->primary_key => $primary_key));
    }

note the (error) difference between insert_title and insert_description when browsing to the directory:

http://www.creations...ge/insert_title
http://www.creations...ert_description

files: http://www.creations...m/imagecrud.zip (or see attachment)

Thanks alot in advance!
#2

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums!

I'm sorry, I've no idea why that's not working, and I don't currently have the time to sift through the code to figure it out. If you find a solution, please let us know.

However, I would recommend you don't merge your changes into the original file. Instead you'd be better off extending it. Keeping your changes separate from the source code will make it easier to upgrade if there are any bug fixes or features added in future releases.




Theme © iAndrew 2016 - Forum software by © MyBB