<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class DbCheck extends CI_Controller {
    public function index() {
        $tables = ['productocategoria', 'productocategoriaopcion', 'productomodificador'];
        foreach ($tables as $table) {
            echo "<h3>Table: $table</h3>";
            if ($this->db->table_exists($table)) {
                $fields = $this->db->list_fields($table);
                echo "<ul>";
                foreach ($fields as $field) {
                    echo "<li>$field</li>";
                }
                echo "</ul>";
            } else {
                echo "<p>Table does not exist</p>";
            }
        }
    }
}
