i have stored image data in a sql table when uploading images. then i want to delete individual images with ajax.
here is my php code to retrieve images from table. there are few images.
while($infoi= mysqli_fetch_array($ri, MYSQLI_ASSOC)){
$imageId= $infoi['image_id'];
$albumIdi= $infoi['album_id'];
$imageName= $infoi['image_name'];
$size= $infoi['size'];
$type= $infoi['type'];
$mainImage= $infoi['main_image_file_path'];
$thumbImage= $infoi['thumb_image_file_path'];
$addedDayi= $infoi['added_day'];
echo ' <tr class="'.$imageId.'">
<td> <a href="'.$mainImage.'" data-lightbox="'.$albumIdi.'"> <img src="'.$thumbImage.'" class="img-responsive thumbnail" /> </a></td>
<td> '.$imageName.' </td>
<td> '.$size.' Kb </td>
<td>'.$addedDayi.'</td>
<input type="submit" class=" btn btn-sm btn-danger ico-windows" id="'.$imageId.'" value="Delete"/>
<div class="showResult" id="'.$imageId.'" style=""> this division hided </div>
}// inner while
how i pass the image id via ajax to the php script?
in php i can use query string to pass the imageId but in ajax i have no idea to how to it.
if deleted successfully whole table row should be hided and if not deleted an error message should be showed in div class="showResult"