I'm having trouble with my search engine. The T_variable error is appearing. ERROR IS LINE 31. Whats wrong? 27. { 28. 29.//constuct query 30. $x++ 31. $construct .= "keywords LIKE '%$search_each%'"; 32. else 33. $construct .="OR keywords LIKE '%$search_each%'"; 34. 35. } Thanks!
There is no if function? if(something) $construct .= "keywords LIKE '%$search_each%'"; else $construct .="OR keywords LIKE '%$search_each%'"
Also I noted you didn't terminate the line: $x++ with a semicolon. If that's not just a typo in your posting and is in the actual code, the PHP parser would see the line as: $x++ $construct .= "keywords LIKE '%$search_each%'"; But what the error is actually saying is that the PHP parser was expecting an open parenthesis but found a variable - which would be the case if you didn't include an "if (condition)" clause as ssmm987 mentioned.
if (function) { //constuct query $x++ $construct .= "keywords LIKE '%$search_each%'"; } else { $construct .="OR keywords LIKE '%$search_each%'"; }
if (function) { //constuct query $x++; $construct .= "keywords LIKE '%$search_each%'"; } else { $construct .="OR keywords LIKE '%$search_each%'"; }
I must have been snoozing when mentioned the $x++ not being terminated point... If so, the parser would just fail - giving no error. Hope you fixed your issue.