Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter reggs12

    (@reggs12)

    I can’t do that. There are other fields that are based upon the current date so no matter what I have to change the logic around coming from the database. The only way I would be able to use p.calendar_end is if what was saved in the database didn’t need to be reworked. I know it doesn’t look like that field needs to be split up like that but there are other fields that definitely do. So I go back to asking why the WHERE statement breaks the search and if there is some way to get around it?

    This statement works as long as you make “calendar_term” a date field.

    SELECT p.ID,p.post_title,pp.post_date,
    CONCAT(SUBSTRING(p.calendar_end, 1, 4),'/',SUBSTRING(p.calendar_end, 5, 2),'/',SUBSTRING(SUBSTRING(p.calendar_end, 5), -2)) as calendar_term
    FROM payments as p
    LEFT JOIN payments_posts AS pp ON pp.post_id = p.post_id

    As soon as I add the WHERE to the bottom it returns all records instead of just one like the initial error caused by not assigning calendar_term to be a date field.

    SELECT p.ID,p.post_title,pp.post_date,
    CONCAT(SUBSTRING(p.calendar_end, 1, 4),'/',SUBSTRING(p.calendar_end, 5, 2),'/',SUBSTRING(SUBSTRING(p.calendar_end, 5), -2)) as calendar_term
    FROM payments as p
    LEFT JOIN payments_posts AS pp ON pp.post_id = p.post_id
    where p.post_last_save_date = pp.post_date

    Do I need to edit the way the plugin handles the query and if so what file and line number would that be? Thanks for your help.

    Thread Starter reggs12

    (@reggs12)

    So I assigned a “Date” field to calendar_term and the search started working again. The only problem is when I add my where statement the search gets broken again and returns everything instead of nothing. Any tips on how to handle the where?

    SELECT p.ID,p.post_title,pp.post_date,
    CONCAT(SUBSTRING(p.calendar_end, 1, 4),'/',SUBSTRING(p.calendar_end, 5, 2),'/',SUBSTRING(SUBSTRING(p.calendar_end, 5), -2)) as calendar_term
    FROM payments as p
    LEFT JOIN payments_posts AS pp ON pp.post_id = p.post_id
    where p.post_last_save_date = pp.post_date
    Thread Starter reggs12

    (@reggs12)

    FYI I set up a view in mysql and got the same error. Looks like you can’t include the set command inside the view.

    Thread Starter reggs12

    (@reggs12)

    I see you have “$wpdb->query( ‘SET session wait_timeout = 800’ );” in the api.php. I am assuming the query for the reports display is in exports-and-reoprts.php. I am hoping if I run $wpdb->query( ‘SET SQL_BIG_SELECTS=1’ ); right before the report query it will include that SET in session and allow the report to display the record like it does in phpmyadmin. Can you tell me where the query for the report display page is?

    Thread Starter reggs12

    (@reggs12)

    Ok I will look into that thanks.

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