⚠ 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

Multiple Image Crud uploaders in one page



Bruno Palma
  • profile picture
  • Member

Posted 30 June 2015 - 10:24 AM

Hello!

 

I'm building a website that has two different image crud uploaders for two different tables.

 

I'm defining them like this:


$image_crud = new image_CRUD();
$image_crud->set_table('sketch_gallery');
$image_crud->set_primary_key_field('id');
$image_crud->set_url_field('url');
$image_crud->set_artist_profile($id)
->set_ordering_field('priority')
->set_image_path('assets/uploads');


$data['output'] = $image_crud->render();


$image_crud = new image_CRUD();
$image_crud->set_table('tattoo_gallery');
$image_crud->set_primary_key_field('id');
$image_crud->set_url_field('url');
$image_crud->set_artist_profile($id)
->set_ordering_field('priority')
->set_image_path('assets/uploads');


$data['output2'] = $image_crud->render();

For some reason, everytime I use the second uploader, the image gets uploaded into the first table. I thought it was some element id problem, but I changed it and I'm still facing the same problem.

 

I've lost literally 2 days trying to fix it, can please someone give me an hand?

 

Thank you!

 


Mike
  • profile picture
  • Member

Posted 05 July 2015 - 19:54 PM

Maybe i am telling nonsense but have you tried to clear the $image_crud object, and/or create a new one with different name?, it had to be a different one, but if something is wrong it may cache the data and work wrong.

 

Greetings!