Received: from server1.edupresence.com (Mrbcomm.com [209.61.186.167] (may be forged)) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6DHZda73238 for ; Fri, 13 Jul 2001 13:35:39 -0400 (EDT) (envelope-from anepon@verveinternet.com) Received: from [141.151.10.188] (adsl-141-151-10-188.bellatlantic.net [141.151.10.188]) by server1.edupresence.com (8.9.3/8.9.3) with SMTP id MAA19474 for ; Fri, 13 Jul 2001 12:35:35 -0500 Reply-To: From: "Ari Nepon" To: "Pgsql-Sql" Subject: You have an error in your SQL syntax near '' at line 1 Date: Fri, 13 Jul 2001 13:38:50 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal X-Archive-Number: 200107/176 X-Sequence-Number: 3968 Hi, I keep getting this error "You have an error in your SQL syntax near '' at line 1" when I try to run the below query. Does anyone know what I'm missing? Maybe some of the variables need to be in single or double qoutes? I tried a bunch of things, but no change. tbl_all holds the foreign keys and some columns of non-relational data. the other tbl_somethinghere tables hold two columns, the primary key and a name. $columns_to_select ="tbl_users.username_field, tbl_client.name, tbl_project.project_name, tbl_task.task_name, tbl_all.description, tbl_all.hours, tbl_all.date_field"; $left_join ="LEFT JOIN tbl_users ON tbl_all.employee_ID = tbl_users.username_field LEFT JOIN tbl_client ON tbl_all.client_ID=tbl_client.name LEFT JOIN tbl_project ON tbl_all.project_ID=tbl_project.project_name"; $left_join2="LEFT JOIN tbl_task ON tbl_all.task_ID=tbl_task.task_name"; $where="WHERE tbl_all.client_ID = $clients"; $all_query ="SELECT $columns_to_select FROM tbl_all $left_join $left_join2 $where"; Thanks, Ari ~~~~~~~~~~~~~~~~~~~~~~~~~ Ari Nepon MRB Communications 4520 Wilde Street, Ste. 2 Philadelphia, PA 19127 p: 215.508.4920 f: 215.508.4590 http://www.mrbcomm.com ----------------------------------------------------------------------- Sign up for our email list and receive free information about topics of interest to nonprofit communications, marketing, and community building professionals. Free resources, articles, tips. Go to http://www.mrbcomm.com and use the Mailing List form. -----------------------------------------------------------------------