exec("ALTER TABLE shipments ADD COLUMN shipper_id INT NULL AFTER id"); $pdo->exec("ALTER TABLE shipments ADD COLUMN truck_owner_id INT NULL AFTER offer_price"); // Add FK constraints (optional but good practice, keeping it simple for now to avoid issues with existing data) // We won't enforce FK strictly on existing data as it might be NULL echo "Added shipper_id and truck_owner_id to shipments table."; } catch (PDOException $e) { echo "Error (might already exist): " . $e->getMessage(); }