如何执行正在执行多个操作的 SQL 语句?
当我尝试执行以下代码时,出现错误Fuel\Core\Database_Exception [ 1064 ]: You have an error in your SQL syntax;
嵌入 MySQL 的 PHP
$sql = "
SET @sql = CONCAT(
'CREATE TEMPORARY TABLE IF NOT EXISTS temp_compiled_properties AS
(SELECT
id,
', @sql, '
FROM properties
WHERE properties.property_id = ?
GROUP BY properties.property_id)');
PREPARE stmt FROM @sql;
EXECUTE stmt USING @property_id;
DEALLOCATE PREPARE stmt;";
DB::query($sql)->execute();