Hello, I ve the following code and the if is always returning returning true:
function db_LA() {
$this->u_tst=".....";
$qry_1=mysql_query("SELECT COUNT(`yyy`) FROM `tbl` WHERE `id_tst`='".$this->u_tst."' ");
$fetch_1=mysql_result($qry_1,0,0);
if($fetch_1==0) {
$qry_2=mysql_query("INSERT INTO `tbl` (...) VALUES (...) or die(mysql_error());
}
if($fetch_1>0 && $fetch_1<4) {
$qry_2_Update=mysql_query("UPDATE `tbl` SET `att` = `att` +1 WHERE `id`='".$this->u_tst."');
}
}
//if($fetch_1>0 && $fetch_1<4) { <---- this is being exsecuted even if the value was above 4