funcional
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Ver estructura de la tabla message_templates
|
||||
*/
|
||||
|
||||
require_once 'config/config.php';
|
||||
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
|
||||
try {
|
||||
$db = Database::getInstance();
|
||||
|
||||
echo "=== ESTRUCTURA DE TABLA message_templates ===\n\n";
|
||||
|
||||
// Describir la tabla
|
||||
$stmt = $db->query("DESCRIBE message_templates");
|
||||
$columns = $stmt->fetchAll();
|
||||
|
||||
echo "Columnas disponibles:\n";
|
||||
foreach ($columns as $column) {
|
||||
echo "• {$column['Field']} ({$column['Type']}) - {$column['Null']} - {$column['Default']}\n";
|
||||
}
|
||||
|
||||
echo "\n=== INTENTAR INSERCIÓN SIMPLE ===\n";
|
||||
|
||||
// Intentar inserción con campos mínimos
|
||||
$stmt = $db->query(
|
||||
"INSERT INTO message_templates (template_name, language_code, status) VALUES (?, ?, ?)",
|
||||
['hello_world', 'en_US', 'approved']
|
||||
);
|
||||
|
||||
if ($stmt) {
|
||||
echo "✅ Plantilla 'hello_world' agregada exitosamente\n";
|
||||
}
|
||||
|
||||
// Verificar que se agregó
|
||||
echo "\n📋 Plantillas en la BD:\n";
|
||||
$stmt = $db->query("SELECT * FROM message_templates");
|
||||
$templates = $stmt->fetchAll();
|
||||
|
||||
foreach ($templates as $template) {
|
||||
echo "• {$template['template_name']} ({$template['language_code']}) - {$template['status']}\n";
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo "❌ Error: " . $e->getMessage() . "\n";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user