fetchAll("SHOW COLUMNS FROM conversations LIKE 'status'"); print_r($rows); $distinct = $db->fetchAll("SELECT DISTINCT status FROM conversations"); echo "Distinct status values in table:\n"; print_r(array_column($distinct, 'status')); // Ask user confirmation (CLI only) if (php_sapi_name() === 'cli') { echo "About to alter column 'status' to ENUM('sent','delivered','read','failed','received') DEFAULT 'sent'. Continue? (y/N): "; $resp = trim(fgets(STDIN)); if (strtolower($resp) !== 'y') { echo "Aborted by user.\n"; exit; } } $db->query("ALTER TABLE conversations MODIFY COLUMN status ENUM('sent','delivered','read','failed','received') DEFAULT 'sent'"); echo "ALTER OK\n"; } catch (Exception $e) { echo "ERROR: " . $e->getMessage() . "\n"; }