The below query will only return a result if the first word of a field does not match. How can I fix this. Thanks
if ($company == \"\")
{$company = \'%\';}
if ($code == \"\")
{$code = \'%\';}
if ($zip == \"\")
{$zip = \'%\';}
$result = mysql_query (\"SELECT * FROM $usertable
WHERE company LIKE \'$company %\'
AND code LIKE \'$code %\'
AND zip LIKE \'$zip %\'
\");
if ($row = mysql_fetch_array($result)) {
do {
print \"<b>\".$row[\"company\"].\"</b>\";
print (\"<br>\");
print \"<i>\".$row[\"contact\"].\"</i>\";
print (\"<br>\");
print $row[\"address\"];
print (\"<br>\");
print $row[\"city\"];
print (\", \");
print $row[\"state\"];
print (\" \");
print $row[\"zip\"];
print (\"<br>\");
print (\"<b>Phone:</b> \"); print $row[\"phone\"];
print (\" \"); print (\"<b>Fax:</b> \"); print $row[\"fax\"];
print (\"<br>\");
print (\"<b>Email:</b> \"); print \"<a href=mailto:\".$row[\"email\"].\">\".$row[\"email\"].\"</a>\";
print (\"<br>\");
print (\"<b>Web Site:</b> \"); print \"<a href=http://\".$row[\"url\"].\">\".$row[\"url\"].\"</a>\";
print (\"<br>\");
print (\"<b>Category:</b> \"); print $row[\"code\"];
print (\"<br>\");
print (\"_________________________________________________\");
print (\"<p>\");
} while($row = mysql_fetch_array($result));
} else {print \"Sorry, no records were found! Click your Back Button to search again.\";}