Hello all I am having truble with this code php and mysql query code below i ahve a table called Poreba and columns PartN, PartD, partT what i am trying to to is query PartN column (abc-741100-00168-F4) this is what I am trying to search for it comes out ok if i search for the whole thing but when I am trying to search only for couple of the numbers inside it wont work for example 74100 does not work can anyone help thank you in adavce $key=$_GET['key']; $results=mysql_query ("Select PartT FROM Poreba where MATCH (PartT) AGAMINST ('key'");
$key = $_GET['key']; $result = mysql_query ("Select `PartT` FROM `Poreba` WHERE MATCH (`PartT`) AGAINST ('$key')"); PHP:
original $key=$_GET['key']; $result= mysql_query ("Select `PartN` FROM `Poreba` WHERE MATCH (`PartN`) AGAINST ('$key')"); I did change that echo "<table border='1' bgcolor='#F4F4F4' cell padding='1' table align='center'>"; echo "<tr> <th>Part Number</th> <th>Part Type </th> <th>Part Description </th></tr>"; while($row = mysql_fetch_array($result)){ $num_rows = mysql_num_rows($result); however if i use this $results=mysql_query ("Select * FROM Poreba where PartN Like '%$key%'"); it works expect it does do any search within the - - statement only the last 2 digits or the whole thing thanks for the info
this works just fine with everything $key=$_GET['key']; $results=mysql_query ("Select * FROM Poreba WHERE PartN LIKE '%$key%' or PartDes LIKE'%$key%' or PartT LIKE '%$key%'"); but using other search query method it doesn't show anything $results= mysql_query ("Select `PartN` FROM `Poreba` WHERE MATCH (`PartN`) AGAINST ('$key')"); the match against method just wont work for me have no Idea why not can anyone explaint it to me thank you