Cannot Add Advanced mySQL Query

5 posts by 3 authors in: Forums > CMS Builder
Last Post: June 3, 2013   (RSS)

By Perchpole - May 29, 2013 - edited: May 29, 2013

Hello, All -

I've created a fairly complex mySQL query to generate a list in a CMSB editor. However, although the thing works perfectly in phpMyAdmin I can't even set it up in CMSB.

I paste the code into the field and hit save only to be rewarded with an error message:

There was an error sending the request! (404 Not Found)

The code for the  query is:

SELECT 
  cms_pages.name AS LABELS, 
  CONCAT( CAST(cms_settings.indexPage AS CHAR), "?p=", CAST(cms_pages.num AS CHAR) ) AS VALUES
  FROM `cms_settings`, `cms_pages` 
  WHERE cms_pages.hidden != 1

It should produce a result like this: /index.php?p=num (where num is the number of a page)

It works fine in phpMyAdmin.

I'm using CMSB v2.52

:0/

Perch

By Steve99 - May 29, 2013

Hi,

Are you trying to populate a drop down list menu in the CMSB back end?

- Steve

By Daryl - May 29, 2013

Hi Perch,

Would you mind if we take a closer look at the problem by submitting a second level support request?

You can find the request form here: https://www.interactivetools.com/support/email_support_form.php

Thanks,

Daryl

Daryl Maximo
PHP Programmer - interactivetools.com

By Perchpole - June 3, 2013

Thanks for the update (via support email).

There is clearly a problem with Modsecurity on this server. Unfortunately, previous experience tells me that the host was never likely to change anything in a hurry.

For that reason I decided to insert the mySQL query manualy by editing the schema file. This appears to have worked and I am very pleased with the results.

There's always a way!

:0)

Perchpole