PHP
- 14 ответов
- 0 вопросов
3
Вклад в тег
+--------------------------------------+
| id | cat_id | status |
+--------------------------------------+
SELECT * FROM `cat_statuses` as cs
RIGHT JOIN `test_b` as tb ON (as.cat_id = tb.services)
WHERE cs.cat_id=4;
$mapping = json_decode(file_get_contents('test.json'));
$code = 'R2';
$name = '';
foreach ($mapping as $item) {
if ($item->iata == $code) {
$name = $item->name;
break;
}
}
echo $name;
foreach($json as $val) { ?>
<?
$mapping = json_decode(file_get_contents('test.json'));
$name = '';
$code = $val['airline']
foreach ($mapping as $item) {
if ($item->iata == $code) {
$name = $item->name;
break;
}
}
?>
<div style="background:#ffffff; color:#008BE0!important;font-weight:bold;">Цена: <?=$val['price']?> Авиакомпания: <?=$name?> Номер рейса: <?=$val['flight_number']?></div>
.....
<?php } ?>