SELECT c.id, c.caption, COUNT(*) billcount
FROM wmail_company c
JOIN wmail_order o ON o.company_id = c.id
JOIN wmail_comm_bill b ON b.order_id = o.id
GROUP BY c.id, c.caption ORDER BY billcount DESC LIMIT 0, 50
...
location ... {
...
fastcgi_pass ...;
fastcgi_param MY_PARAM "123";
...
}
...
$pdo = new PDO("mysql:host=localhost;dbname=...;","db_user","password");
$statement = $pdo->prepare(
"SELECT * FROM posts p JOIN posts_category pc ON pc.category_id = p.posts_category_id
WHERE pc.category_alias = ?"
);
$statement->bindValue(1, $name, \PDO::PARAM_STR);
$statement->execute();
$result = $statement->fetchAll(\PDO::FETCH_ASSOC);
...
while($city = $result->fetch_assoc()) {
$array[mb_substr($city['city_name'], 0, 1, 'UTF-8')][] = $city;
}
...
...
// И вставляем туда картинку
var $img = $('#add_photo_' + id).find('img');
if ($img.length === 0) {
$("#add_photo_" + id).prepend('<img style="display:block; position:absolute; z-index:0; top:0px; max-width:135px; max-height:135px;" src="/photo/advert/crop/' + filename + '" />');
} else {
$img.prop('src', '/photo/advert/crop/' + filename);
}
...
location /somefile.php\?.* {
error_page 418 = @with_id;
recursive_error_pages on;
if ($args ~ id=) {
return 418;
}
#without id
...
}
location @with_id {
...
}
function isFirefox() {
return navigator.userAgent.toLowerCase().indexOf('firefox') != -1;
}
server {
server_name site.ru;
rewrite ^ http://newsite.ru$request_uri? permanent;
}