This topic is locked
[SOLVED]

 What is wrong with the syntax in the SQL below

12/28/2012 5:10:58 PM
PHPRunner General questions
L
lewisekrantz author

SELECT

punchlist.pun_id,

punchlist.pun_proj,

punchlist.pun_date,

punchlist.pun_desc,

punchlist.pun_uid,

punchlist.pun_status,

punchlist.pun_priority,

userprojects.ID0,

userprojects.id,

userprojects.project_id,

userprojects.projectname,

userprojects.user_id,

userprojects.user_name

FROM punchlist

INNER JOIN userprojects ON punchlist.pun_uid = userprojects.user_id

WHERE $_SESSION["UserID"] = userprojects.user_name

C
cgphp 12/28/2012

The where clause in the SQL query can't contain PHP code.

Remove the where clause from the SQL query and add the where clause to the "Before SQL query" event as follows:

$strWhereClause = whereAdd($strWhereClause, "userprojects.user_name ='" . $_SESSION["UserID"] . "'");