$array = range(1, 16);
shuffle($array);
echo implode('<br/>', array_slice($array, 0, 4));
.map-ukraine {
transform: scale(0.5);
}
select *
from t1
inner join t2 on t1.link_field = t2.link_field and t2.some_field <> 0 and t2.other_field <> 0
мне нужно, для которых нет ни одного значения равного нулю
select * from t1 where id not in (select id_field from t2 where some_field = 0)
Вообще таблицы такие:
questions(id, text), answers(id, question_id, answer, text), history(id, user_id, answer_id, question_id, test_id), history_tests(id, date), нужно вывести все вопросы, на которые все существующие ответы верны.
select q.*
from questions q
inner join history h on h.question_id = q.id
where q.id not in (
select a.question_id
from answers a
inner join history h on a.id = h.answer_id and a.answer = 0
)
public function check($orderId)
{
$url = $this->url.'load_adv_adv.php';
$pageid = 0;
$found = false;
while (!$found)
{
$result = $this->http($url, array('page' => $pageid), true);
preg_match('/({[^{}]*?'.$orderId.'.+?})/', $result, $matches);
if (isset($matches[1]))
{
$found = true;
$order = $matches[1];
}
else
{
$pageid++;
}
}
return $order;
}
public function check($orderId)
{
$url = $this->url.'load_adv_adv.php';
$pageid = 0;
while (true)
{
$result = $this->http($url, array('page' => $pageid), true);
preg_match('/({[^{}]*?'.$orderId.'.+?})/', $result, $matches);
if (isset($matches[1]))
{
return $matches[1];
}
$pageid++;
}
}