prepare('UPDATE horses SET name = ?, breed = ?, description = ?, image_url = ? WHERE id = ?'); $stmt->execute([$name, $breed, $description, $image_url, $horse_id]); header('Location: admin_horses.php?edited=true'); exit; } catch (PDOException $e) { $errors[] = 'Database error: ' . $e->getMessage(); } } } // Fetch the horse try { $pdo = db(); $stmt = $pdo->prepare('SELECT * FROM horses WHERE id = ?'); $stmt->execute([$horse_id]); $horse = $stmt->fetch(); if (!$horse) { header('Location: admin_horses.php'); exit; } } catch (PDOException $e) { $errors[] = 'Database error: ' . $e->getMessage(); } ?> Admin: Edit Horse

Edit Horse:

← Back to Manage Horses

Edit Horse Details