views:

35

answers:

2

whats wrong with this? anybody help me please..

if(stripos($nerde, $hf) !== false) && (stripos($nerde, $rs) !== false){
    @mysql_query("update table set dltur = '3' where id = '".$ppl[id]."'");

}
else {
//dont do anything
}

i get T_BOOLEAN_AND error.

+2  A: 

The entire condition needs parentheses:

if((stripos($nerde, $hf) !== false) && (stripos($nerde, $rs) !== false)){
Ignacio Vazquez-Abrams
+1 for typing faster than me (and being correct, of course)
timdev
thank you. i will accept answer 10 minutes later.
Ronnie Chester Lynwood
+2  A: 

The whole expression of an if condition needs to be put in parentheses. But you’re already closing that part of the if statement after the first false:

if(stripos($nerde, $hf) !== false) && (stripos($nerde, $rs) !== false){
  ^       ^___________^          ^
  |______________________________|

Write it this way:

if (stripos($nerde, $hf) !== false && stripos($nerde, $rs) !== false)

Or you put parentheses around the whole expression (Ignacio Vazquez-Abrams suggested):

if ((stripos($nerde, $hf) !== false) && (stripos($nerde, $rs) !== false))
Gumbo