<?php
$sql = mysqli_query($link, 'SELECT `ID`, `st_form` FROM `q6m0n_qf3_ps` WHERE st_user="'.mysqli_real_escape_string($link, $_REQUEST['user']).'"');
while ($result = mysqli_fetch_array($sql)) {
echo "{$result['st_form']}";
}
?>
SELECT * FROM `table` WHERE `категория`='1' AND `подкатегория`='2' AND `под-подкатегория`='5'
$sql = mysql_query("SELECT * FROM TotalTickets ORDER BY email ASC") or die(mysql_error());
$cust_email = false; $cust_txt = ""; $cust_sum = 0;
while($cust = mysql_fetch_array($sql, MYSQL_ASSOC))
{
if ($cust_email !== false AND $cust_email != $cust['email'])
{
echo '<tbody class="labels">
<tr>
<td colspan="5">
<label for="accounting">'.$cust_email.': '.round($cust_sum, 2).'</label>
<input type="checkbox" name="accounting" id="accounting" data-toggle="toggle">
</td>
</tr>
</tbody>
<tbody class="hide">
'.$cust_txt.'
</tbody> ';
$cust_email = $cust['email'];
$cust_txt = "";
$cust_sum = 0;
}
$cust_sum += $cust['price'];
$cust_txt .= ' <tr>
<td>'.$cust['filmName'].'</td>
<td>'.$cust['date'].'</td>
<td>'.$cust['timeBegin'].'</td>
<td>'.$cust['price'].'</td>
<td>0</td>
</tr>';
}
if (!empty($cust_txt))
{
echo '<tbody class="labels">
<tr>
<td colspan="5">
<label for="accounting">'.$cust_email.': '.round($cust_sum, 2).'</label>
<input type="checkbox" name="accounting" id="accounting" data-toggle="toggle">
</td>
</tr>
</tbody>
<tbody class="hide">
'.$cust_txt.'
</tbody> ';
}