I'm struggling with a MySQL select statement. I need to be able to filter the SELECT on one of 6 fields, depending upon the user-entered data. In the example below, '$processor_type' is constructed to represent the required filter field. This will be either celeron, duron, athlon, etc. (the table field names).
I need to achieve the equivalent of:
SELECT name FROM $dbtable where socket='$socket' AND celeron>='$speed' " as an example.
My code currently looks like this:
$result = mysql_query( "SELECT name FROM $dbtable where socket='$socket' AND $processor_type>='$speed' " );
Is it possible to do what I'm trying to achieve??
Thanks in advance for any sugestions.