Hy io have this php script(if you can call php script) anyway i whant that every result to show it one down the another(mysql grid table) but with that kind of search....i've tryied but unf nothing....
this is the "code"
<?php
$i = 0;
if ($_REQUEST["string"]<>'') { $search_string = " AND (id LIKE '%".mysql_real_escape_string($_REQUEST["string"])."%' OR category LIKE '%".mysql_real_escape_string($_REQUEST["string"])."%')"; }
if ($_REQUEST["city"]<>'') {
$search_city = " AND category='".mysql_real_escape_string($_REQUEST["city"])."'"; }
if ($_REQUEST["from"]<>'' and $_REQUEST["to"]<>'') {
$sql = "select date,category,sum(q1) Total,sum(q2) Total2,sum(q3) Total3,sum(q4) Total4,sum(q5) Total5,sum(q6) Total6 from articles WHERE date >= '".mysql_real_escape_string($_REQUEST["from"])."' AND date <= '".mysql_real_escape_string($_REQUEST["to"])."'".$search_string.$search_city." group by category";}
else if ($_REQUEST["from"]<>'') {
$sql = "select date,category,sum(q1) Total,sum(q2) Total2,sum(q3) Total3,sum(q4) Total4,sum(q5) Total5,sum(q6) Total6 from articles WHERE date >= '".mysql_real_escape_string($_REQUEST["from"])."'".$search_string.$search_city." group by category";}
else if ($_REQUEST["to"]<>'') {
$sql = "select date,category,sum(q1) Total,sum(q2) Total2,sum(q3) Total3,sum(q4) Total4,sum(q5) Total5,sum(q6) Total6 from articles WHERE date <= '".mysql_real_escape_string($_REQUEST["to"])."'".$search_string.$search_city." group by category";}
else { $sql = "select date,category,sum(q1) Total,sum(q2) Total2,sum(q3) Total3,sum(q4) Total4,sum(q5) Total5,sum(q6) Total6 from articles WHERE id>0".$search_string.$search_city; } $sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql);
if (mysql_num_rows($sql_result)>0) {
while ($row = mysql_fetch_array($sql_result)) {
$id = $row["id"];
$member_name = $row["id"];
if ($i % 9 == 0) {
echo'
<tr><td>$_REQUEST["from"]</td>
<td>$_REQUEST["to"]</td>
<td>$row["category"]</td>
<td>$row["Total6"]</td>
<td>$row["Total"]</td>
<td>$row["Total2"]</td>
<td>'.$row["Total3"].'</td>
<td>'.$row["id"].'</td>
<td>'.$member_name.'</td>
</tr>
';
} else {
'<td>' . $member_name . '</td>';
}
$i++;
?>
<?php } } else {
?><tr><td colspan="5">No results found.</td><?php }
?></table><br><br><div class='row no-print'><button class='btn btn-defaul' onclick='window.print();'><i class='fa fa-print'></i>Stampa</button></i><br></div>