I have a form set up with a dropdown list of values for a field "manufacturer" in my database
I can pass the variable to my php script. I know this because I use:
$manufacturer = $_POST['manufacturer'];
echo "<h1> Query result for manufacturer = ","$manufacturer", "</h1>";
And the page prints the appropriate value chosen from the form.
I'm trying to use the $manufacturer variable in a mysql query to select records which match.
My mysql query works when I use the following code:
$result = mysql_query("SELECT * FROM serialtest WHERE manufacturer = 'Yamaha'") or die(mysql_error());
but not when I add the $_POST[manufacturer] value in place of 'Yamaha'
The error I get is: "Unknown column 'Yamaha' in 'where clause'"
Is it my syntax?
Many thanks for any help you can give.