如何在mysql中上传带有链接的多个图像

Currently I have a code which is working perfectly for one image upload. But i want to upload multiple images at a time with same Image Title, Image Description for image group being uploaded as these images will be used in photo slideshow(See Images below please)

My Current Code is as follows -

PHP Code -

    $bsq->connect_db();
    $fileName = $_FILES["image"]["name"]; 
    $fileNameNew = preg_replace('/\s+/', '_', $fileName);
    $fileTmpLoc = $_FILES["image"]["tmp_name"];
    // Path and file name
    $pathAndName = "uploads_admin/".$fileNameNew;
    // Run the move_uploaded_file() function here
    $moveResult = move_uploaded_file($fileTmpLoc, $pathAndName);
    // Evaluate the value returned from the function if needed


    if($_POST['action']=="add"){
           $all_columns[]="image_subject";
           $all_columns[]="image_name"; 
           $all_columns[]="clinic"; 
           $all_columns[]="image_link";



//Get All values to insert in to table      
           $all_values[]=addslashes($_POST["image_subject"]);
           $all_values[]=addslashes($_POST["image_name"]);  
           $all_values[]=addslashes($_POST["clinic"]);
           $all_values[]=addslashes($pathAndName );


//=====================

$qry=$bsq->webdreaminsert("sa_galleryuploads_by_admin",$all_columns,$all_values,'');
echo mysql_error();

header("location:upload_file_for_downloading_list.php");
    ///////////////////////////////////////////////////
    }   

And HTML Form For upload Image Is As follows -

      <form action="" method="post" enctype="multipart/form-data" name="addtwebinar1" id="addtwebinar1" onsubmit="javascript:return validateimage1();" >
      <input type="hidden" value="add" name="action" />

      <table width="90%" align="center" border="0" cellpadding="0" cellspacing="0" class="ListTable1">
      <tr class="HeadBr">
      <td colspan="4"><div align="center"><strong>Add Images For Photo Gallery</strong></div></td>
      </tr>

      <tr >
      <td>Image Title*</td>
      <td><input name="image_name" id="image_name" type="text" size="40" value="" /></td>
      </tr>
      <tr>   
      <td>Image Description In Short*</td>
      <td><input name="image_subject" id="image_subject" type="text" size="40" value="" /></td>
      </tr>
      <tr >
      <td>Clinic Name*</td>
      <td>
           <select name="clinic" id="message" >
        <option value="">Select Clinic</option>
        <option value="arogya">1. Arogyawardhini Ayurved Clinic</option>
        <option value="smruti">2. Smruti Ayurved Clinic</option>
        <option value="tarpan">3. Tarpan Ayurved Clinic</option>
        <option value="vishwa">4. Vishwawardhini Ayurved Clinic</option>
        </select>
              </td>
              </tr>                
              <tr >
                <td>Your Image For Upload* </td>
                <td><label for="image">File To Upload: </label><br>
                <input type="file" size="40" name="image"  id="image" /><br />
               </td>
               </tr>    

               <tr>
               <td></td>
               <td><button >Upload</button></td>
              </tr>
            </table>
            </form>

Current Look of My Active Image upload Form - enter image description here And I Want Like Below (Created Graphically) enter image description here

You can use a for loop.

For the form, do something like this:

for($i = 1; $i <= 4; $i++) {
        echo "<input type=\"file\" size=\"40\" name=\"image{$i}\"  id=\"image{$i}\" /><br />";
}

And for the processing, just put all of that in a for loop as well.

   for($i = 1; $i <= 4; $i++) { 
   $fileName = $_FILES["image".$i]["name"]; 
   $fileNameNew = preg_replace('/\s+/', '_', $fileName); 
   $fileTmpLoc = $_FILES["image".$i]["tmp_name"]; 
    // Path and file name 
   $pathAndName = "uploads_admin/".$fileNameNew; 
   // Run the move_uploaded_file() function here 
   $moveResult = move_uploaded_file($fileTmpLoc, $pathAndName); 
  // Evaluate the value returned from the function if needed 


  if($_POST['action']=="add"){ 

  $image_name = mysql_real_escape_string($_POST['image_name']); 
  $image_subject = mysql_real_escape_string($_POST['image_subject']); 
  $clinic = mysql_real_escape_string($_POST['clinic']); 
  $image_link = "http://".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), "\\/")."/".$pathAndName; 

  //===================== 

  mysql_query("INSERT INTO `sa_galleryuploads_by_admin` VALUES ('', '{$image_name}',  '{$image_subject}', '{$clinic}', '{$image_link}' )") or die(mysql_error()); 

  if(!mysql_error()) { 
     echo "success"; 
   } 

   } 

You can edit the number that the loop goes up to, to match the number of fields/images you want to show. Good luck!

edit: You also need to sanitize validate your inputs. At the very least, use mysql_real_escape_string().

Also, mysql_* functions are deprecated. You should switch to using either mysqli or pdo. I'd suggest mysqli to start off, because it also offers a procedural approach, whereas pdo is completely object oriented.