I'm trying to query a database and display it on a webpage. The current query is:
$query_string = 'SELECT * FROM charContracts WHERE `type` = courier ORDER BY `charContracts`.`status` DESC';
I ahve also tried this:
$query_string = 'SELECT * FROM charContracts WHERE `charContracts`.`type` = courier ORDER BY `charContracts`.`status` DESC';
Currently these both give me the below error:
display_db_query:Unknown column 'courier' in 'where clause'
I'm using this in phpyadmin but when i try to copy this in a get a syntax error with php.
SELECT *
FROM charContracts
WHERE `charContracts`.`type` = 'courier'
ORDER BY `charContracts`.`status` DESC
Can anyone tell me where i'm wrong. (For Reference.. charContracts is the table, type is a column and courier is one of the choices)
Put "courier" in quotes so that it is interpreted as a string. Now it is interpreted as a column name which is obviously not there.