Search query - how do I ...
Posted: Fri Dec 17, 2004 9:40 am
Hi folks
It's "this dumb person" back again - I'm thinking of adding a signature something like "I know it can be done - I just don't know how"
Anyhow this (I hope) is not too taxing. The following query actually works!!
BUT
how can I "remove" the useless words from the array - i.e. those words like in, a, the, etc.
Because when the search is done naturally it returns matches against all the words without ignoring the in,a,the's etc.
Your help much appreciated but to pls help me, remember I am only a fool who gets things to work by complete trial and error and not by knowing what I am actually doing

It's "this dumb person" back again - I'm thinking of adding a signature something like "I know it can be done - I just don't know how"
Anyhow this (I hope) is not too taxing. The following query actually works!!
Code: Select all
<?php
$item = explode(' ',$_POST['skillfield']);
print_r ($item);
echo "<p>";
//get number of words
$count = count($item);
echo "<br>";
print $count;
echo "<p>";
for ($i=0; $i <count($item); $i++)
if (isset($item[$i]))
{
$sql = "SELECT * FROM allquals WHERE Qualification LIKE '%$item[$i]%'";
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs, MYSQL_ASSOC))
{
echo $row['Qualification'];
echo " ";
echo $row['QNo'];
echo "<br>";
}
}
}
?>how can I "remove" the useless words from the array - i.e. those words like in, a, the, etc.
Because when the search is done naturally it returns matches against all the words without ignoring the in,a,the's etc.
Your help much appreciated but to pls help me, remember I am only a fool who gets things to work by complete trial and error and not by knowing what I am actually doing