What is wrong with this WHERE clause?

Posted by Victor on Stack Overflow See other posts from Stack Overflow or by Victor
Published on 2009-10-22T09:01:15Z Indexed on 2012/06/09 4:41 UTC
Read the original article Hit count: 522

Filed under:
|

Is there a reason why this query doesn't work? The following query will work if I just exclude the WHERE clause. I need to know what is wrong with it. I know the given values of $key exists in the table, so why doesn't this work?

$q =   "SELECT * WHERE t1.project=$key
            FROM project_technologies AS t1
            JOIN languages AS t2
            ON t1.language = t2.key";

Table's have the following fields:

project_technologies
- key
- project
- language

languages
- key
- name

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql