This function gives me related videos
$ch=explode(" ",$list[2]);
if(count($ch)>1)for($i=1;$i<count($ch);$i++)$chnl.="or keyword like '%$ch[$i]%'";
$sql="SELECT VID from video where type='public' $active and (keyword like '%$ch[0]%' $chnl) order by VID asc";
This function works properly, but gives me a notive in my error log:
PHP Notice: Undefined variable: chnl in /var/www/....../video.php on line 445
where line 445 corresponds with
if(count($ch)>1)for($i=1;$i<count($ch);$i++)$chnl.="or keyword like '%$ch[$i]%'";
I can't seem to see how else I should make $chnl a defined var to start with?
Any pointers would be appreciated!