prepare($sql); $stmt->bindParam(':name', $name, PDO::PARAM_STR); $stmt->bindParam(':quantity', $quantity, PDO::PARAM_STR); $stmt->bindParam(':pickup_by', $pickup_by, PDO::PARAM_STR); $stmt->bindParam(':description', $description, PDO::PARAM_STR); $stmt->bindParam(':latitude', $latitude, PDO::PARAM_STR); // PDO uses STR for decimals $stmt->bindParam(':longitude', $longitude, PDO::PARAM_STR); if ($stmt->execute()) { header('Location: add_listing.php?status=success'); } else { header('Location: add_listing.php?status=error'); } } catch (PDOException $e) { // In a real app, you would log this error, not expose it. // error_log($e->getMessage()); header('Location: add_listing.php?status=error'); } exit();