Welcome Guest, Not a member yet? Register   Sign In
unlink photo
#8

[eluser]Narkboy[/eluser]
Ok - so you want to remove an image, and then reuse the same id?

So - delete image id 8, then be redirected to the upload page so that you can upload a new image with id 8?

It's do-able, but the big question is why would you?

If you store images in the database, then you can manually specify the id field:

Code:
$insert = array(
    'image_id' => '8',
    'image_filename' => 'file.jpg'
};

$this->db->insert('table_name',$insert);

I assume that the field for id's in the db is autoinc? In which case, you shouldn't get an error if you specify the id.

However, I don't see a reason why you would need or want to. You'd require two insert functions - one for specifying the id, and one for when you don't want to specify.

Why not just allow the database to sort the ids for you?

/B


Messages In This Thread
unlink photo - by El Forum - 10-21-2010, 07:44 PM
unlink photo - by El Forum - 10-22-2010, 02:27 AM
unlink photo - by El Forum - 10-22-2010, 05:08 AM
unlink photo - by El Forum - 10-22-2010, 05:42 AM
unlink photo - by El Forum - 10-22-2010, 06:00 AM
unlink photo - by El Forum - 10-22-2010, 06:29 AM
unlink photo - by El Forum - 10-22-2010, 07:09 AM
unlink photo - by El Forum - 10-22-2010, 08:59 AM
unlink photo - by El Forum - 10-22-2010, 09:34 AM
unlink photo - by El Forum - 10-22-2010, 09:49 AM
unlink photo - by El Forum - 10-22-2010, 10:13 AM
unlink photo - by El Forum - 10-22-2010, 10:28 AM
unlink photo - by El Forum - 10-22-2010, 10:35 AM
unlink photo - by El Forum - 10-22-2010, 11:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB