lundi 2 mars 2015

SQL error: Unknown column in 'where clause'


I have following very simple PHP MySQL Query:



$sql = 'SELECT * FROM bundesland WHERE bkuerzel = ' . $_GET['q'];
$result = mysql_query($sql, $con);


When I execute the query with a click on a item with the value "Wien" on a dropdown menu I get "SQL error:Unknown column 'Wien' in 'where clause' in", but as you can see in the picture below I have the column.


Picture of my database table





Aucun commentaire:

Enregistrer un commentaire