The Problem
When using EM_Booking#get(), an SQL error is thrown.
Possible Cause
get() tries to retrieve the table name from $wpdb:
$sql = "SELECT * FROM ". $wpdb->EM_BOOKINGS_TABLE ." WHERE " . implode(' AND ', $conds);
That results in a query like the following:
That's because there's no such thing as $wpdb->EM_BOOKINGS_TABLE.
Suggested Solution
Use constants, the same way as everywhere else in the plugin:
$sql = "SELECT * FROM ". EM_BOOKINGS_TABLE ." WHERE " . implode(' AND ', $conds);
Remarks
I am aware that this repo has not been updated in a long time. However, the problem still presents on 5.9.x: see trac.
The Problem
When using
EM_Booking#get(), an SQL error is thrown.Possible Cause
get()tries to retrieve the table name from$wpdb:That results in a query like the following:
That's because there's no such thing as
$wpdb->EM_BOOKINGS_TABLE.Suggested Solution
Use constants, the same way as everywhere else in the plugin:
Remarks
I am aware that this repo has not been updated in a long time. However, the problem still presents on
5.9.x: see trac.