Help on search query with wildcards pls. - solved ty
Posted: Sat Dec 11, 2004 5:39 am
Hi folks
Can anyone help me figure this one out please.
I am trying to create a very simple search script using wildcards. User enters a keyword in a text field and submits that to this query
The search needs only to look through 1 table and 1 field within that table. The text in the field to search is obviously longer than the key wor, but I would like all the rows returned that include the keyword $search.
For some reason my SQL doesn't work, yet the $search variable is passed via the $_POST etc..
Any help please, thanks in advance
Can anyone help me figure this one out please.
I am trying to create a very simple search script using wildcards. User enters a keyword in a text field and submits that to this query
Code: Select all
<?php
$search = $_POST['search'];
$sqlqualsearch = "SELECT Qualification FROM allquals WHERE Qualification LIKE '% ".$search ." %'";
$rsqualsearch = mysql_query($sqlqualsearch);
while ($row = mysql_fetch_object($rsqualsearch))
{
echo $row['Qualification'];
}
?>For some reason my SQL doesn't work, yet the $search variable is passed via the $_POST etc..
Any help please, thanks in advance