<input type="text" name="answers[0][answer]">
<input type="checkbox" name="answers[0][right]" value="1" >
<input type="text" name="answers[1][answer]">
<input type="checkbox" name="answers[1][right]" value="1" >
<input type="text" name="answers[2][answer]">
<input type="checkbox" name="answers[2][right]" value="1" >
onSuccess: function() {
this.ui.upload.show();
this.ui.edit.show();
this.ui.proceed.show();
this.ui.actions.show();
},
onError: function() {
this.ui.upload.show();
this.ui.edit.hide();
this.ui.proceed.hide();
this.ui.actions.hide();
}
<?php
$arr = [
'0' => [
'foo1' => 'bar1',
'foo2' => 'bar2',
'foo3' => 'buz1',
'floor' => 1,
],
'1' => [
'foo1' => 'bar1',
'foo2' => 'bar2',
'foo3' => 'buz2',
'floor' => 7,
],
'3' => [
'foo1' => 'bar3',
'foo2' => 'bar4',
'foo3' => 'buz3',
'floor' => 1,
],
];
$result = [];
foreach ($arr as $item)
{
$key = $item['foo1'].'&'.$item['foo2']; // Разделитель для ключа нужно подбирать исходя из того, что хранится в foo1 и foo2
if (!array_key_exists($key, $result))
{
$result[$key] = [
'foo1' => $item['foo1'],
'foo2' => $item['foo2'],
'dependence' => []
];
}
$result[$key]['dependence'][$item['floor']] = $item['foo3'];
}
$result = array_values($result);
echo '<pre>';
var_dump($result);
echo '</pre>';
?>
$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++;
}
}