Forum Moderators: coopster

Message Too Old, No Replies

Warning: in array() [function.in-array]:

         

adammc

6:25 am on Oct 10, 2006 (gmt 0)

10+ Year Member



Hi Guys,

I have just received the following error:

Warning: in_array() [function.in-array]: Wrong datatype for second argument line 57

// Check if $condition is empty (If its empty condition = any )

If (!in_array("any",$condition) && count($condition)>0)
{
// Format the Condition
$ConditionSQL=" AND (";
for ($a=0; $a < count($condition); $a++)
{
$ConditionSQL.="condition LIKE '%".trim($condition[$a])."%' OR ";
}
$ConditionSQL=substr($ConditionSQL,0,strlen($ConditionSQL)-4);
$ConditionSQL.=")";
}

What I am trying to do here is if the variable $condition is empty I want it to then equal 'any'.

adammc

8:13 am on Oct 10, 2006 (gmt 0)

10+ Year Member



I got it sorted, thanx anyway.

adammc

8:14 am on Oct 10, 2006 (gmt 0)

10+ Year Member




if(is_array($condition) AND!in_array('any', $condition))

dreamcatcher

9:47 am on Oct 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad you got it sorted adammc. :)

dc