We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using EM_Booking#get(), an SQL error is thrown.
EM_Booking#get()
get() tries to retrieve the table name from $wpdb:
get()
$wpdb
$sql = "SELECT * FROM ". $wpdb->EM_BOOKINGS_TABLE ." WHERE " . implode(' AND ', $conds);
That results in a query like the following:
SELECT * FROM WHERE 1
That's because there's no such thing as $wpdb->EM_BOOKINGS_TABLE.
$wpdb->EM_BOOKINGS_TABLE
Use constants, the same way as everywhere else in the plugin:
$sql = "SELECT * FROM ". EM_BOOKINGS_TABLE ." WHERE " . implode(' AND ', $conds);
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.
5.9.x
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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.The text was updated successfully, but these errors were encountered: