I have a db of a list of words which are listed in groups. I am trying to compair thoes words to some words that my users type in.
db example
Group Name -> Words
names -> bob sms david
cars -> suv barbi hotwheels
books -> are too much work
my code:
Code: Select all
$lookup=mysql_query('SELECT group, keywords FROM groups WHERE keywords!=""');
for($t=0;$t<=mysql_num_rows($lookup);$t++)
{
$lookup3[$t]=mysql_fetch_array($lookup);
$group[$t]=$lookup3[$t][group];
$dbwords[$group[$t]]=split(' ',$lookup3[$t][keywords]);
for($a=0;$a<=count($group);$a++)
{
//echo $a.'<br>';
$compair=array_intersect_assoc($dbwords[$group[$t]],$wordtofetch); //wordtofetch is defined earlyer, and is just what the user types
}
//echo 'this url: '.$dbwords[$t].' has this in common: '.$compair[$t].' with: '.$wordtofetch[$t].'<br>';
//echo $compair[$t].'<br>';
}the only thing I cannot get to work, is it to tell me what groups the matches are in. it will tell me when theres matches...
any ideas, tia nilrem[/php_man]