<?php
require 'config/Conexion.php';

$sql = "SHOW COLUMNS FROM persona";
$result = ejecutarConsulta($sql);

$found_sangre = false;
$found_historia = false;

echo "<h3>Columnas en tabla 'persona':</h3><ul>";
while ($row = $result->fetch_assoc()) {
    echo "<li>" . $row['Field'] . "</li>";
    if ($row['Field'] == 'tipo_sangre')
        $found_sangre = true;
    if ($row['Field'] == 'historia_clinica')
        $found_historia = true;
}
echo "</ul>";

echo "<h3>Estado:</h3>";
if ($found_sangre)
    echo "<p style='color:green'>[OK] columna 'tipo_sangre' ENCONTRADA.</p>";
else
    echo "<p style='color:red'>[ERROR] columna 'tipo_sangre' NO ENCONTRADA.</p>";

if ($found_historia)
    echo "<p style='color:green'>[OK] columna 'historia_clinica' ENCONTRADA.</p>";
else
    echo "<p style='color:red'>[ERROR] columna 'historia_clinica' NO ENCONTRADA.</p>";
?>