I have a strange problem in an IF inside a mysql_fetch_array that works weirdly … working on the first occurrence and not on the next ones.
I have this:
while ($season != "2011/12"){
while($res = mysql_fetch_array($result)){
echo "<strong>Resultado: </strong>" . $res['resultado'];
echo "<br />";
if($res['resultado'] == "V" || $res['resultado'] == 1){
$total_titulos = $total_titulos + 1;
echo "<strong>Total Titulos: " . $total_titulos . "</strong><br />";
}
}
echo "<hr />";
}
$res['resultado'] values can be: V, F, SF, 1, 2, 3, 4, or 5.
The variable $total_titulos is always incremented when it gets the value 1 but in case it gets a V it is only incremented in the first one it gets, and not on the ones after.
This never happened to me so I’m quite overwhelmed by this. Any help?
I don’t really know what happened wrong, or what the problem was, but the problem was on the MySQL. This did the trick:
Maybe some weird encoding.