I have a table in MySQL named \"updates\" that currently holds the following information:
What I need is the
The answer is simple. You can always run every query from your set as a separate query() call. this is universal rule for running multi-query statements.
$mysqli->query('SET @sql = NULL');
$mysqli->query(<<query("SET @sql = CONCAT('SELECT Action, ', @sql, ' FROM updates GROUP BY Action');");
$mysqli->query("PREPARE stmt FROM @sql");
$res = $mysqli->query("EXECUTE stmt");
var_dump($res->fetch_all(MYSQLI_ASSOC));
but please remember that by this kind of query your are essentially running an SQL injection against your own database. As long as the field type is date
it cannot do any harm, but for any text type - watch out!