PHP-Code:
$spl = "
CREATE TABLE `dsb_content` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`tstamp` int(10) unsigned NOT NULL DEFAULT 0,
`headline` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`date` int(10) unsigned NOT NULL DEFAULT 0,
`time` int(11) NOT NULL DEFAULT 0,
`subheadline` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`teaser` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`author` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`singleSRC` binary(16) DEFAULT NULL,
`alt` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`imageTitle` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`size` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`fullsize` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`caption` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`floating` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'above',
`published` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
";
$objDSOL = $objDSOLDB->prepare($sql)
->execute();
Leider funktioniert der SQL-String nur in phpMyAdmin. Die Datenbank-Klasse verabschiedet sich mit:
request.CRITICAL: Uncaught PHP Exception Exception: "Empty query string" at /vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php line 123 {"exception":"[object] (Exception(code: 0): Empty query string at /vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php:123)"} []
Kann Contao keine Tabellen anlegen oder wird der SQL-String vorher noch von Contao "massakriert"?
EDIT: Schreibfehler - q und p sind schwer zu unterscheiden.
Lesezeichen