Title: $having_clause conditional
Last modified: September 1, 2016

---

# $having_clause conditional

 *  Resolved [Phan Chuong](https://wordpress.org/support/users/pltchuong/)
 * (@pltchuong)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/having_clause-conditional/)
 * I recently upgraded to 4.5.07 and my page was broken. After a while digging into
   problems with no successful, I compared with the old version 4.4.23 and figured
   this out:
 * In latest version 4.5.07, file /include/class.ajax.php:353 you now have a condition
   to apply LIMIT in SQL query. In my case (not sure abt other users) there is no`
   $having_clause`, so there is no LIMIT in the query, this make my entire 7000+
   + results returned and my browser is completely hang.
 * Right now I have to use your filter `slp_ajaxsql_fullquery` to append this LIMIT,
   this is my last attempt to fix this issue without touching plugin code base, 
   but can you let me know if this is the default/good behavior?
 * Regards,
    — Phan
 * [https://wordpress.org/plugins/store-locator-le/](https://wordpress.org/plugins/store-locator-le/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [cyndyec](https://wordpress.org/support/users/cyndyec/)
 * (@cyndyec)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/having_clause-conditional/#post-7554149)
 * Hi Phan,
    I have marked your questions for the developer, author to explain. 
   The [changelog for 4.5.08 ](https://wordpress.org/plugins/store-locator-le/changelog/)
   does address many of the filters changes, but you mention you had problems with
   4.5.07, so I will let Lance Address that.
 *  Plugin Author [Lance Cleveland](https://wordpress.org/support/users/charlestonsw/)
 * (@charlestonsw)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/having_clause-conditional/#post-7554150)
 * What is your site URL? Also – please register and post in the forums at [https://www.storelocatorplus.com/](https://www.storelocatorplus.com/)
   as the forum posts come up in our Slack and support channels so we know you need
   help. We don’t check here very often.
 * As for the limit – it should be applied on both a page load and search based 
   on your settings under the Experience / Search (user search) and Experience /
   Results (initial page load) tabs.
 *  Plugin Author [Lance Cleveland](https://wordpress.org/support/users/charlestonsw/)
 * (@charlestonsw)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/having_clause-conditional/#post-7554151)
 * Sorry – they are both in Experience / Results… “Number To Show Initially” and“
   Max Search Results” settings. They should never be blank or you get “all locations”.
 *  Thread Starter [Phan Chuong](https://wordpress.org/support/users/pltchuong/)
 * (@pltchuong)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/having_clause-conditional/#post-7554152)
 * Hi yes I saw that configuration. It works as expected **IF** the `$having_clause`
   is NOT null/blank/empty. However, again, in my case, there is no `$having_clause`,
   and that’s why it return entire locations.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘$having_clause conditional’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/store-locator-le_dac7af.svg)
 * [Store Locator Plus®](https://wordpress.org/plugins/store-locator-le/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/store-locator-le/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/store-locator-le/)
 * [Active Topics](https://wordpress.org/support/plugin/store-locator-le/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/store-locator-le/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/store-locator-le/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Phan Chuong](https://wordpress.org/support/users/pltchuong/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/having_clause-conditional/#post-7554152)
 * Status: resolved