[wp-trac] [WordPress Trac] #42776: WP(v.4.9.1) error in wp-db.php
WordPress Trac
noreply at wordpress.org
Sun Dec 3 07:31:25 UTC 2017
#42776: WP(v.4.9.1) error in wp-db.php
--------------------------+-----------------------------
Reporter: adminkov | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 4.9.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Working on my plugin, I found that when I send a request to
a database where there is one field empty - then WP (v.4.9.1) gives an
error and stop.
Example:
1. my request: $sql = "INSERT INTO
{$wpdb->prefix}watchman_site_cross_table (`date_country`, `tbl_country`,
`tbl_result`) SELECT DATE_FORMAT(`time_visit`,'%Y %m') as `date_country`,
LEFT(`country`,4) as `tbl_country`, COUNT(`user_ip`) as `tbl_result` FROM
{$wpdb->prefix}watchman_site GROUP BY `date_country`, `tbl_country` ORDER
BY `tbl_country` "; $wpdb->query($sql);
2. The message in the admin panel:
Fatal error: Cannot access empty property in D:OpenServerdomainsadminkov
.localwp-includes wp-db.php on line 1901
3.The reason for WP break is that the 'country' field is empty. Maybe this
will help you improve WP(v.4.9.1). Good luck.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42776>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list