Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #42776


Ignore:
Timestamp:
12/03/2017 07:49:33 AM (7 years ago)
Author:
dd32
Comment:

Hi @adminkov,

Can you please verify the code needed to reproduce this? With the code provided, being a INSERT it shouldn't have been running on line 1901 as that's for select-based queries. Was it indeed a SELECT query which you were running?

The code in question (The first large block deals with INSERT's, the second highlight is the line which triggered the fatal) https://core.trac.wordpress.org/browser/tags/4.9.1/src/wp-includes/wp-db.php?marks=1877-1892,1901#L1874

Thanks!

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #42776

    • Property Keywords reporter-feedback added
  • Ticket #42776 – Description

    initial v1  
    33error and stop.
    44Example:
    5 1. my request: $sql = "INSERT INTO
     51. my request:
     6{{{
     7$sql = "INSERT INTO
    68{$wpdb->prefix}watchman_site_cross_table (`date_country`, `tbl_country`,
    79`tbl_result`) SELECT DATE_FORMAT(`time_visit`,'%Y %m') as `date_country`,
    810LEFT(`country`,4) as `tbl_country`, COUNT(`user_ip`) as `tbl_result` FROM
    911{$wpdb->prefix}watchman_site GROUP BY `date_country`, `tbl_country` ORDER
    10 BY `tbl_country` "; $wpdb->query($sql);
     12BY `tbl_country` ";
     13$wpdb->query($sql);
     14}}}
    11152. The message in the admin panel:
    1216Fatal error: Cannot access empty property in D:OpenServerdomainsadminkov.localwp-includes wp-db.php on line 1901