[Solved] Getting syntax errror when adding second where clause [closed]


Your quotation mark is in the wrong place.

$results = $wpdb->get_results("
SELECT wp_users.ID, wp_users.display_name,
stories.SID, stories.story_name, stories.category,
writing.text, writing.approved
FROM stories
INNER JOIN wp_users ON stories.ID = wp_users.ID
INNER JOIN writing ON stories.SID = writing.SID
WHERE (stories.SID = $the_SID) AND (writing.approved = 'Y')");

4

solved Getting syntax errror when adding second where clause [closed]