• Resolved syedmeesam

    (@syedmeesam)


    I am using the following shortcode:

    [sqlgetvar]SELECT CONCAT(CAST(date_format(STR_TO_DATE(englishdate,’%m/%d/%Y’),’%M %d, %Y’) AS CHAR), ” / “, islamicmonth, ” “, dayofmonth, ” “, hijriyear) AS islamicdate FROM islamicdates WHERE date_format(STR_TO_DATE(englishdate,’%m/%d/%Y’),’%c/%d/%Y’)=date_format(now(),’%c/%d/%Y’)[/sqlgetvar]

    I have also pasted the exact same query and saved it as a report, where it runs fine and returns the record as expected like this:
    ===============================
    islamicdate
    ===============================
    May 17, 2018 / Ramadhan 1 1439
    ===============================

    But I am still getting the following error on the page where I have used the shortcode:

    Notice: Undefined index: SELECT CONCAT(CAST(date_format(STR_TO_DATE(englishdate,’%m/%d/%Y’),’%M %d, %Y’) AS CHAR), ” / “, islamicmonth, ” “, dayofmonth, ” “, hijriyear) AS islamicdate FROM islamicdates WHERE date_format(STR_TO_DATE(englishdate,’%m/%d/%Y’),’%c/%d/%Y’)=date_format(now(),’%c/%d/%Y’) in /home/alkhoe5/public_html/wp-content/plugins/elisqlreports/index.php on line 947
    This SQL Query has not been allowed by an Administrator.

    • This topic was modified 6 years, 6 months ago by syedmeesam.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Eli

    (@scheeeli)

    That error indicates that you do not actually have that shortcode query defined as a report. Are you sure that you copied the query EXACTLY and it is identical in both places (even the spacing and capitalization needs to be the same for the hashes to match)?

    Thread Starter syedmeesam

    (@syedmeesam)

    Yes. I have actually copy+pasted the sql from the report into the shortcode.

    Here is the URL to the page: https://www.al-khoei.org/about-2/

    Also I noticed that if I use a simple query such as SELECT COUNT(*) FROM wp_users the result does show but with the undefined index error.

    • This reply was modified 6 years, 6 months ago by syedmeesam.
    • This reply was modified 6 years, 6 months ago by syedmeesam.
    Plugin Author Eli

    (@scheeeli)

    Try changing that line 947 in /home/alkhoe5/public_html/wp-content/plugins/elisqlreports/index.php

    Form:
    elseif (isset($GLOBALS[“ELISQLREPORTS”][“reports_array”][$GLOBALS[“ELISQLREPORTS”][“reports_keys”][$MySQL]]))

    To:
    elseif (isset($GLOBALS[“ELISQLREPORTS”][“reports_keys”][$MySQL]) && isset($GLOBALS[“ELISQLREPORTS”][“reports_array”][$GLOBALS[“ELISQLREPORTS”][“reports_keys”][$MySQL]]))

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Undefined Index’ is closed to new replies.