I have a from with 2 fields:
Company & Name
Depening which is completed, one of the following queries will be run:
if($Company){
$query = "Select C*
From tblsample
Where ID = $Company
Order By Company ASC";
}
if($Name){
$query = "SELECT *
FROM TBLsample
WHERE Contact = "%$Name%"
ORDER BY Contact ASC";
}
$result = mysql_query($query);
$number = mysql_numrows($result);
for ($i=0; $i<$number; $i++) {
$CompanyName = mysql_result($result,$i,"Company");
$ContactName = mysql_result($result,$i,"Contact");
Print "Company: $CompanyName";
Print "<P>Name: $ContactName";
}
This work fine for 'Company', but not for 'Name'
How do I do a wild search using $Name in the Where statement.. ?
Ie $Name = Jim
So %Jim% should result in :
Jim
jimmy
jimm
etc !!
Thanks