lundi 23 décembre 2019

Trying to add a unique record_id number to a php RAND function

I have a website that I use PHP and mysql database and Apache server and I have a record page and it has a unique record_id number each record gets a unique record_id number and I get to my photo gallery page from the record page and the unique record_id number goes to the photo gallery page throw the URL, and in the photo gallery page I can upload image to my server uploads folder where the image ($image_name) and the thumbnail ($image thumbnail_name) go to and the unique record_id number and title and record_date and image_name and thumbnail_name go to my database in the recoed_images table. and when I upload a image it gets the name of the image change to a rand number by using a php ($image_name = rand (1000,9999).".".$fileExt;) all that works good but I need the unique record_id number to be add infront of the RAND number so the images will have a name like (record_id=1_5826) and (record_id=1_thumbnail_5826) or like (record_id=2_9631) and (record_id=1_thumbnail_9631) so I can filter the image by the record_id number in the photo gallery page so you will only see the images for that one record.can that be done?




Aucun commentaire:

Enregistrer un commentaire