Where am I going wrong

A

Anonymous

Guest
I am trying to create a search to pick out Yamaha models from a list of various manufacturers.
The user inputs the model of the equipment and the query searches for matching entries based on the two matching criteria.

However, the script below always returns an error can anyone see the problem?

$query = "select MAKE,MODEL,PRICE,REF,DISC,ID,SKU from remotes where MAKE like YAMAHA AND MODEL like \"%$trimmed%\"
order by MAKE";

$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);


TIA
 
elfeste said:
I am trying to create a search to pick out Yamaha models from a list of various manufacturers.
The user inputs the model of the equipment and the query searches for matching entries based on the two matching criteria.

However, the script below always returns an error can anyone see the problem?

$query = "select MAKE,MODEL,PRICE,REF,DISC,ID,SKU from remotes where MAKE like YAMAHA AND MODEL like "%$trimmed%"
order by MAKE";

$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);


TIA
try this:
$query = 'select MAKE,MODEL,PRICE,REF,DISC,ID,SKU from remotes where MAKE like "YAMAHA" AND MODEL like "'.$trimmed.'" order by MAKE';
 
Back
Top