Q:

URL Imageupload / Database set up

I am trying to store an image in my database via the URL(image location).
I will like to only store the file name and the php will complete the url. My question: Do i need to add an id field to my table? Also the file maybe different ext(jpg, gif, png) how can the php determine that?
If your curious, I am using this image upload from this SITE 
The URL that is generated by the code:
http://www.example.com/imageupload/uploads/medium/uniqueimagename.jpg

My database structure:
size: medium
name: uniqueimagename
ext: jpg/png/gif

A:

you can pass the image name like this www.example.com/imageupload/uploads/medium?img=uniqueimagename.jpg and you can get name by using $_GET['img'] and yes you have to store the id into your database.Also dont worry abt the extension because the img will store in your folder and just fetch the image name from your db and display in your img tag 

