Unknown Column in Field List
Posted: Tue Jul 13, 2010 10:28 am
The error:
Basically I'm trying to append "_name" to the $add_type string, so that it works something like this:
$add_type = "school";
SELECT school_name FROM t_school ...
I need to be able to append the _name and pre-pend(?) t_ so that this code can dynamically process inputs from a number of different types of forms.
The relevant code:Unknown column 'item' in 'field list'
Code: Select all
$result = mysql_query("SELECT $add_type " . "_name FROM t_" . "$add_type WHERE $obj_name = $add_type" . "_name") or die(mysql_error());
$add_type = "school";
SELECT school_name FROM t_school ...
I need to be able to append the _name and pre-pend(?) t_ so that this code can dynamically process inputs from a number of different types of forms.