$request = $mysqli->prepare("SELECT `name` FROM `category` WHERE `id` = ?");
$request->bind_param('i', $_GET['category']);
$request->bind_result($title_name);
$request->execute();
while ($request->fetch()) {
$title = $title_name.' — Решебник онлайн';
}
$request->close();
SELECT *
FROM (
SELECT DISTINCT `date_create`
FROM `ordres`
UNION SELECT `date_modified`
FROM `ordres`
WHERE `status` IN (2, 3)
) AS `date`
LEFT JOIN (
SELECT COUNT(*) AS `count`, `date_create`
FROM `ordres`
GROUP BY `date_create`
) AS `all` ON `all`.`date_create` = `date`.`date_create`
LEFT JOIN (
SELECT COUNT(*) AS `count`, `date_modified`
FROM `ordres`
WHERE `status` = 2
GROUP BY `date_modified`
) AS `succ` ON `succ`.`date_modified` = `date`.`date_create`
LEFT JOIN (
SELECT COUNT(*) AS `count`, `date_modified`
FROM `ordres`
WHERE `status` = 3
GROUP BY `date_modified`
) AS `canc` ON `canc`.`date_modified` = `date`.`date_create`
$text = preg_replace("/(?<=[а-яё:;,.])\s*•/ismu", " <br>•", $text);
replacement may contain references of the form \\n or (since PHP 4.0.4) $n, with the latter form being the preferred one. Every such reference will be replaced by the text captured by the n'th parenthesized pattern.
CREATE TABLE IF NOT EXISTS oF_tour_table_'15' LIKE oF_tour_table_template
SELECT `p`.`title`, `p`.`text`, `t`.`tag`
FROM (
SELECT `title` FROM `posts` WHERE ... LIMIT 10
) AS `p`
LEFT JOIN `post_tag` AS `pt` ON `pt`.`post_id` = `p`.`id`
LEFT JOIN `tags` AS `t` ON `t`.`id` = `pt`.`tag_id`
ORDER BY `p`.`title`, `t`.`tag`