[eluser]LynxCoder[/eluser]
[quote author="the_unforgiven" date="1334315251"]
LynxCoder (like the username by the way) thanks for you help much appreciated,[/quote]
Excellent! Glad it all works! My usual point to start debugging is to echo out the variables and say what have i buggered up!!! Your welcome anyway!
[quote author="the_unforgiven" date="1334315630"]My next question is what do i use to get the thumb stored to the db, currently have:
Code:
$image_data = $this->upload->data();
$data['item_img'] = $image_data['file_name'];
[/quote]
I'm assuming that your storing the reference to the filename and not the actual thumbnail? In which case its just a simple case of doing
Code:
$this->db->where('uniqueid',$UID);
$this->db->update('tablename',$data);
Assuming that a record already exists in the table and your just updating it with the thumbnail filename - in which case you should already have the $UID - obviously replace 'uniqueid' and 'tablename' with the appropriate values.
EDIT: I'm assuming that the fieldname in the table is 'item_img', if not, then you need to change $data['item_img'] to be $data['fieldname'], replacing fieldname with the appropriate fieldname of course!!
Alternatively, if you are just adding the thumbnail as a fresh record then
Code:
$this->db->insert('tablename',$data);
plus any other data your looking to store alongside it of course!
Assuming that all your thumbnails are stored in the same folder, then you only need to store the actual filename in the DB, not the path, which will reduce the data footprint of the DB. If thumbnails are stored in various places, then you'll need to store the path too.