I loop a query. I check if the value of each record contains within any string (in the case $ message). The problem is that when the value is found, in this case inside ELSE , the while is terminated for some reason. I need the verification to continue to be done on all records, until the end of the records.
$query = "select id, id_usuario texto from palavra";
$result = mysql_query($query);
while($palavras = mysql_fetch_array($result)) {
$valor = $palavras["texto"];
$iduser = $palavras["id_usuario"];
if(!strpos(strtolower($mensagem), strtolower($valor))) {
echo " não.<BR>";
} else {
echo " sim.<BR>";
$query = "select nome from usuario where id = $iduser";
$result = mysql_query($query);
$user_dados = mysql_fetch_row($result);
}
}
If you shoot the internal query, the loop continues normal, as expected. But I need the consultation.