⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

An error has occurred on uploading?



Võ Hào

Võ Hào
  • profile picture
  • Member

Posted 12 May 2013 - 13:39 PM

When I set upload field, i get an error has occurred on uploading (image bellow)

 

Code:

 

       $crud = new grocery_CRUD();

        $crud->set_theme('datatables');
        $crud->set_table('tbl_topic');
        $crud->set_subject('Topic');
        $crud->set_field_upload('file_url','assets/uploads/files');
        $crud->set_relation('cate_id','tbl_category','name');
        $crud->display_as('cate_id','Category');

 

 

 

error.png

 

The file uploaded to assets/uploads/files but this not update to field file_url in table tbl_topic.

Who can help me fix this? Thanks alot


victor

victor
  • profile picture
  • Member

Posted 12 May 2013 - 21:15 PM

read any articles 'how to debug php code' and 'what is the browser error console' and what is CI log.

victor

victor
  • profile picture
  • Member

Posted 12 May 2013 - 21:18 PM

oh, and welcome to the forum :-)

davidoster

davidoster
  • profile picture
  • Member

Posted 12 May 2013 - 23:20 PM

read any articles 'how to debug php code' and 'what is the browser error console' and what is CI log.

 

Check here, /topic/1660-remember-to-use-the-codeigniter-manual/


Võ Hào

Võ Hào
  • profile picture
  • Member

Posted 13 May 2013 - 01:57 AM

Thank to Victor and Davidoster. I have fixed this error. But i do not known why it working.

I checked my code and code in file examples.php (controllers) (of packed grocery-CRUD-1.3.3.zip), I do not detect error. When I copy code in file examples.php and edit for my application, it worked


victor

victor
  • profile picture
  • Member

Posted 13 May 2013 - 08:55 AM

what is your function's name? don't use GC in the main controller ( default controller which you set in the config file) and don't use 'index' for a function's name.