$query = "SELECT COUNT(status) FROM $nomeTabela WHERE status=$numeroStatus AND nomePessoa='$nomePessoa'";
Can you optimize this? There are statuses from 0 to 10 (in this query I need to query only on statuses from 1 to 10 ), I wanted to ignore the 0 for query to be even faster, there some more tips?
foreach ($arrayNomes as $nome) {
$status1 = retornaStatus(1,$nome,$nomeTabela);
$status2 = retornaStatus(2,$nome,$nomeTabela);
$GLOBALS['str'] .=
"<tr>".
'<td>'.$nome."</td>".
'<td>'.$status2."</td>".
'<td>'.$status1."</td>".
"<tr>";
}
echo $GLOBALS['str'];
Inside the function has this query posted above all else.