There is a query mysql_query("DELETE FROM timages WHERE timages.id IN ( SELECT tholidaysimages.imageid FROM tholidaysimages WHERE tholidaysimages.hotelid=".$hotelid mysql_query("UPDATE tholidays set status=0 where id=".$hotelid) Everything works, I don’t know where to dig anymore ??? Full function code:

 function bookingHolidaysDelete($hotelid){ $result = "error"; try { $cn = dbConnect(); if($hotelid > 0) { mysql_query("DELETE FROM timages WHERE timages.id IN ( SELECT tholidaysimages.imageid FROM tholidaysimages WHERE tholidaysimages.hotelid=".$hotelid); //mysql_query("UPDATE tholidays set status=0 where id=".$hotelid); if (mysql_affected_rows() > 0) $result="done"; else $result="Ошибка sql"; } else $result="Не выбрано помещение"; mysql_close($cn); } catch (Exception $e) { $result = $e->getMessage(); } 

return $ result; }

  • And will Pushkin close the brackets in the request for you? :) - check1st 2:49 pm

1 answer 1

And so?

 mysql_query("DELETE FROM timages WHERE timages.id IN ( SELECT tholidaysimages.imageid FROM tholidaysimages WHERE tholidaysimages.hotelid = $hotelid ) "); 
  • Thank you, I am Cancer))) 3 days already in the code, the head flies)))) THANKS !!! - Den