Answers.Body: <p>Looks like you don't have <code>summary_overlay</code> profile in your <code>civicrm_uf_group</code> table. This is a reserved profile which we cannot delete or disable from UI.</p>
  
  <p>So its possible if the name is edited or the profile is deleted from your db due to some reason. To check-</p>
  
  <ol>
  <li>Open <code>civicrm_uf_group</code> table.</li>
  <li>Check for the entry for <code>Summary Overlay</code> profile. This is with id <code>7</code> on <a href="http://dmaster.demo.civicrm.org/civicrm/admin/uf/group?reset=1" rel="nofollow noreferrer">demo site of civicrm</a>.</li>
  <li>If you don't find this profile -  error is due to this reason.</li>
  <li>If you find it - check the name column of this profile and change if it is anything other than <code>summary_overlay</code>.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-22T03:20:38.940Z
Answers.Text: The entry is there .. listed as summer_overlay_7
  
  The other entries there also have their ID number added so I didn't touch this.
Answers.UserDisplayName: Neil Z
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-22T03:41:57.280Z
Answers.Text: hmm - could be due to some unknown reason - but I'm pretty sure error would go off if you replace this with `summary_overlay`.
Answers.UserDisplayName: jitendra - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-23T09:58:53.923Z
Answers.Text: I took your advice, and you were right that fixed the problem.   The question is how did that number appear, and why do the rest have them?
  
  In any case, thanks for the fix !!
Answers.UserDisplayName: Neil Z
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-21T03:12:47.307Z
Answers.LastActivityDate: 2017-06-21T03:12:47.307Z
Answers.UserDisplayName: jitendra - fuzion
Answers.Body: <p>Neil Z - your query missing uf_group_id value in the query ("WHERE uf_group_id =  AND")  - sorry if this is stating the obvious - and i think the value should be whatever the id of the civicrm_uf_group is. Has anyone deleted/disabled groups
  , can you find it in Manage Groups?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-22T03:22:26.143Z
Answers.Text: I agree with you on this, but nothing has changed, and I'm the only one who can change anything on the backend.   This worked fine before the latest update from 4.7.18 to 4.7.20.
  
  Turns out all my user searches are having the same issue.
Answers.UserDisplayName: Neil Z
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-22T03:32:16.937Z
Answers.Text: FWIW .. here's the URL that's created in Joomla to initiate the search:
  
  'index.php?option=com_civicrm&view=Profiles&layout=search&task=civicrm/profile&gid=11&reset=1'
  
  however, that **civicrm/profile** does not look like a correct parameter.
Answers.UserDisplayName: Neil Z
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-22T03:41:05.297Z
Answers.Text: In addition, the fields in the civicrm_uf_field table are correctly associated with the profile using the uf_group ID of 11.
  
  Apparently the **gid=11** parameter is not being parsed and included in the SQL.   Again, I think its due to that forward slash in the **civicrm/profile** part of the URL.
Answers.UserDisplayName: Neil Z
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-20T22:42:17.193Z
Answers.LastActivityDate: 2017-06-20T22:42:17.193Z
Answers.UserDisplayName: Lesley Evensen
Answers.Body: <p>We had exactly the same problem. Changed summary_overlay_7 to Summary_Overlay like before it stopped "DB Syntax error"</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-12T20:28:13.083Z
Answers.Text: and did that fix the problem? sounds like it did but just hoping that if this is an Answer it can be a bit more obvious. thx
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-12T18:05:52.180Z
Answers.LastActivityDate: 2017-07-12T18:05:52.180Z
Answers.UserDisplayName: Sergey Nosenko
Body: <p>All of a sudden my front end name listing/search gives a DB Error.  Any ideas on why this would start now??   This is occuring on the public and the registered access search profiles.</p>
  
  <p>Here's what I found in the Log >> </p>
  
  <p>Using Joomla 3.6.2 and CiviCRM 4.7.20, with MySQL 5.6.35</p>
  
  <hr>
  
  <p>Jun 20 17:18:51  [info] $Fatal Error Details = Array
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => handle
          )</p>
  
  <pre><code>[code] =&gt; -2
  [message] =&gt; DB Error: syntax error
  [mode] =&gt; 16
  [debug_info] =&gt; SELECT count(id) FROM civicrm_uf_field WHERE uf_group_id =  AND visibility IN ('Public Pages', 'Public Pages and Listings')  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND visibility IN ('Public Pages', 'Public Pages and Listings')' at line 1]
  [type] =&gt; DB_Error
  [user_info] =&gt; SELECT count(id) FROM civicrm_uf_field WHERE uf_group_id =  AND visibility IN ('Public Pages', 'Public Pages and Listings')  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND visibility IN ('Public Pages', 'Public Pages and Listings')' at line 1]
  [to_string] =&gt; [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT count(id) FROM civicrm_uf_field WHERE uf_group_id =  AND visibility IN ('Public Pages', 'Public Pages and Listings')  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND visibility IN ('Public Pages', 'Public Pages and Listings')' at line 1]"]
  </code></pre>
  
  <p>)</p>
  
Tags: <profile>
Title: Front End Name List/Search Gives DB Error
ThreadText: # Front End Name List/Search Gives DB Error
  
  (Asked by: username_0 on 2017-06-20)
  
  All of a sudden my front end name listing/search gives a DB Error. Any ideas on why this would start now?? This is occuring on the public and the registered access search profiles.
  
  Here's what I found in the Log >>
  
  Using Joomla 3.6.2 and CiviCRM 4.7.20, with MySQL 5.6.35
  
  ---
  
  Jun 20 17:18:51 [info] $Fatal Error Details = Array
  (
  [callback] => Array
  (
  [0] => CRM\_Core\_Error
  [1] => handle
  )
  
  ```
  [code] => -2
  [message] => DB Error: syntax error
  [mode] => 16
  [debug_info] => SELECT count(id) FROM civicrm_uf_field WHERE uf_group_id =  AND visibility IN ('Public Pages', 'Public Pages and Listings')  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND visibility IN ('Public Pages', 'Public Pages and Listings')' at line 1]
  [type] => DB_Error
  [user_info] => SELECT count(id) FROM civicrm_uf_field WHERE uf_group_id =  AND visibility IN ('Public Pages', 'Public Pages and Listings')  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND visibility IN ('Public Pages', 'Public Pages and Listings')' at line 1]
  [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT count(id) FROM civicrm_uf_field WHERE uf_group_id =  AND visibility IN ('Public Pages', 'Public Pages and Listings')  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND visibility IN ('Public Pages', 'Public Pages and Listings')' at line 1]"]
  
  ```
  
  )
  
  **Tags:** profile
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2017-06-21. Score: 1
  
  Looks like you don't have `summary_overlay` profile in your `civicrm_uf_group` table. This is a reserved profile which we cannot delete or disable from UI.
  
  So its possible if the name is edited or the profile is deleted from your db due to some reason. To check-
  
  1. Open `civicrm_uf_group` table.
  2. Check for the entry for `Summary Overlay` profile. This is with id `7` on [demo site of civicrm](http://dmaster.demo.civicrm.org/civicrm/admin/uf/group?reset=1).
  3. If you don't find this profile - error is due to this reason.
  4. If you find it - check the name column of this profile and change if it is anything other than `summary_overlay`.
  
  > **Comments:**
  > **username_0**: The entry is there .. listed as summer_overlay_7  The other entries there also have their ID number added so I didn't touch this.  
  > **username_1**: hmm - could be due to some unknown reason - but I'm pretty sure error would go off if you replace this with `summary_overlay`.  
  > **username_0**: I took your advice, and you were right that fixed the problem.   The question is how did that number appear, and why do the rest have them?  In any case, thanks for the fix !!  
  
  ---
  
  ### Answer by username_2 on 2017-06-20. Score: 0
  
  username_0 - your query missing uf\_group\_id value in the query ("WHERE uf\_group\_id = AND") - sorry if this is stating the obvious - and i think the value should be whatever the id of the civicrm\_uf\_group is. Has anyone deleted/disabled groups
  , can you find it in Manage Groups?
  
  > **Comments:**
  > **username_0**: I agree with you on this, but nothing has changed, and I'm the only one who can change anything on the backend.   This worked fine before the latest update from 4.7.18 to 4.7.20.  Turns out all my user searches are having the same issue.  
  > **username_0**: FWIW .. here's the URL that's created in Joomla to initiate the search:  'index.php?option=com_civicrm&view=Profiles&layout=search&task=civicrm/profile&gid=11&reset=1'  however, that **civicrm/profile** does not look like a correct parameter.  
  > **username_0**: In addition, the fields in the civicrm_uf_field table are correctly associated with the profile using the uf_group ID of 11.  Apparently the **gid=11** parameter is not being parsed and included in the SQL.   Again, I think its due to that forward slash in the **civicrm/profile** part of the URL.  
  
  ---
  
  ### Answer by username_3 on 2017-07-12. Score: 0
  
  We had exactly the same problem. Changed summary\_overlay\_7 to Summary\_Overlay like before it stopped "DB Syntax error"
  
  > **Comments:**
  > **username_4**: and did that fix the problem? sounds like it did but just hoping that if this is an Answer it can be a bit more obvious. thx  
  
  ---
  
  