i just need help .. i am working on Image library where admin can upload multiple images with single category . The images are in this format like "ABC_12345_business","ABC_23567_business" etc. i want when i click submit button the images will insert into the database along with update the image id[e.g 12345,23567] in a separate row. so that it will easy for me to search the image by image id. can you pls explain me how to do it???
In the HTML <input type="file" name="photo"> In the server side code,include this <?php $target = basename( $_FILES['photo']['name']); // now $target have ABC_12345_business.jpg //separte the target by '_' into array //take the arr[1] you illl get the id like 12345 and save into db ?> Try this it ill work......... Bhuvaneswaran A Web App Develper
1) DO NOT save the image in the database (for many reasons too complex to go into here), save it as a file on the server. Save its filename name (and image name if different) in the database. 2) Since you already have one row for each image, search for the filename where image (or whatever you call the field with the name of the image) = the image you want.