Hello I'm looking to allow users upload pictures onto my site and have it displayed and linked to their site.. This process is for Ad purposes. Ive looked into php mysql uploading images but ive ran into a lot of threads condemning the practice and suggesting saving the images to a directory(and have the path saved in mysql).
Ive never tried uploading, displaying, querying, or loading images from either so I would like to know the major differences.
Are querys that much slower vs loading from directory?
Is it possible to have users upload directly into a directory? is this safe?
If jquery was integrated with the image query would that speed up the response time?
Well like i said they are for Ads. I'm planning on giving them expiration dates and delete them once they've expired. Another question somewhat off topic from this. once i delete the expired entries there will be number gaps in the "id" number sequence.
When I "INSERT" new entries will the new entries fill in those gaps? or be tacked on the end?
When defining your database table, typically the unique identifier is a numerical field, where the value automatically increments. MySQL will then keep a track of what the next id number should be based on those it has previously allocated.
Auto increment would not reallocate the same id value, unless you explicitly changed the tables internal counter.
Don't worry about autoincrement - as blocblue says, the DB will take care of this for you. As long as you've got a robust normalized DB structure, you should be fine.
WRT to expiry dates - if you search for adverts within a set date (e.g. not yet expired), you probably don't need to delete any info. This may be useful to move old ads and related records into archive tables. This way an AD client can search for previous entries and re-activate the AD without having to feed in all the same data again.