Jump to content


Multiple Image Crud uploaders in one page


  • Please log in to reply
1 reply to this topic

#1 Bruno Palma

Bruno Palma

    Newbie

  • Members
  • Pip
  • 1 posts

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!

 



#2 Mike

Mike

    Newbie

  • Members
  • Pip
  • 6 posts
  • LocationValencia (Spain)

Posted 05 July 2015 - 07: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!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users