SELECT n.*
FROM news AS n
JOIN news_tags AS nt ON nt.news_id = n.id
JOIN tags AS t1 ON t1.id = nt.tag_id AND t1.name = "животные"
JOIN tags AS t2 ON t2.id = nt.tag_id AND t2.name = "кроты"
<input name="test" class="testClass" type="number">
<input name="test" class="testClass" type="number">
<input name="test" class="testClass" type="number">
function getValues() {
const numbers = [];
const inputs = document.getElementsByName('test');
for (const input of inputs) {
numbers.push(Number(input.value));
}
return number;
}
location / {
try_files $uri $uri/ /index.html;
root /var/www/frontend/dist;
index index.html;
}
location /api {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://localhost:3000;
}
<select onchange="onSizeChange">
<option value=1>1</option>
<option value=2>2</option>
</select>
<ul>
<li id="price1">100</li>
<li id="price2">200</li>
</ul>
const price1 = [ 100, 200 ];
const price2 = [ 200, 400 ];
function setPrices(prices) {
for (let i in prices) {
document.getElementById('price' + i).innerText = prices[i];
}
}
function onSizeChange(event) {
switch (Number(event.target.value)) {
case 1:
setPrices(price1);
break;
case 2:
setPrices(price1);
break;
}
}
@Entity({name: tableName})
export class EntityClass {
public static tableName = tableName;
@PrimaryColumn()
public name: string = "";
@Column()
public value: number = 0;
}
export function createEntity(tableName: string) {
return EntityClass;
}
$db = new PDO($dsn, $user, $password);
$sth = $db->prepare('SELECT * FROM routes WHERE route = :route LIMIT 1');
$sth->execute([ ':route' => $_SERVER['REQUEST_URI'] ]);
$result = $sth->fetch(PDO::FETCH_ASSOC);
if (!$result) {
echo "Not found!\n";
die();
}
$routeId = $result['id'];
// ваша логика по обработке запроса или отображения страницы
let clicksCount = 0;
let firstCoordinates;
let secondCoordinates;
function clickHandler(event) {
clicksCount++;
const coordinates = { x: event.pageX, y: event.pageY };
switch (clicksCount) {
case 1:
firstCoordinates = coordinates;
break;
case 2:
secondCoordinates = coordinates;
break;
default:
window.removeEventListener('click', clickHandler);
}
};
window.addEventListener('click', clickHandler);