I am using uploadify to upload pictures into server . Back end I am using PHP script . In PHP script I am inserting the file location and some other details in database in addition to copying to target location .
Problem :- If I am uploading 20 files , the PHP script is getting called 20 times and the database insert statement are getting called 20 times to insert for different images . Definitely calling database 20 times is inefficient way of doing it . Is there any way I can hold the file names( and location) and call the insert statement (in the end) only once to insert all the 20 records at once ?
Thanks for your help
Regards
Kiran
One approach I recommend for this is the use of a prepared statement through the
mysqliextension. To quote on the main advantage:Source: https://www.php.net/manual/en/mysqli.prepare.php#103730
To give an example on how you can utilize this:
I’d recommend reading up on mysqli::prepare and mysqli_stmt::bind_param for more information on how the process works. I also recommend reading up on prepared statements in the MySQL documentation.