update two tables with same values but different IDs : I'm trying to update two tables with one query with same value but different IDs. I have been looking for solution but all I have found doesnt work for me
here is the code:

    $Image = $_SESSION["ImageName"];
    $ImageID = $_POST['ImageID'];
    $GalleryID = $_POST['GalleryID'];
    
    $updateSQL = "UPDATE slideimage, gallery
                  SET slideimage.ImageName='".$Image."', gallery.GalleryPoster='".$Image."'
                  WHERE slideimage.ImageID='".$ImageID."'
                  AND gallery.GalleryID='".$GalleryID."'
                  ";

Thank you all for any help