Delete row from table where A=x AND B=y using PHP pdo
Clash Royale CLAN TAG #URR8PPP Delete row from table where A=x AND B=y using PHP pdo I'm trying to delete from a database table where two fields match a value. on the page javascript makes an ajax call to the php file below passing the relevant values, in the response however it returns "[object object]" rather than "deleted" and the record is still in the table. Here's my code in PHP if(isset($_POST['booking'])==true){ $booking = $_POST['booking']; $vec_id= $_POST['id']; $stmt = $pdo->prepare("DELETE FROM booked_vec WHERE booking_id = ? AND vec_id = ?"); $stmt->execute(array($booking,$vec_id)); $stmt = null; } It gets inside the if without problems. $booking and $vec_id both contain the correct values. $pdo is a working connection to the database that works with other statements. I assume something wrong with either the statement or itself or the way I'm passing variables into the statement. I'm unab...