You don’t want to ask wpdb
for each field. This is the wrapper for SQL queries
Like so (not tested):
<?php
$my_results = $wpdb->get_results(
SELECT
posts.post_author, dopbsp_calendars.user_id, dopbsp_reservations.price_total, dopbsp_reservations.check_in, dopbsp_reservations.check_out, dopbsp_reservations.start_hour, dopbsp_reservations.end_hour, dopbsp_calendars.id, posts.post_title, posts.ID As ID1, posts.post_parent, dopbsp_reservations.transaction_id
FROM wp_posts
INNER JOIN
posts.post_author
ON
dopbsp_calendars.user_id
dopbsp_calendars
ON
wp_posts.post_author = dopbsp_calendars.user_id,
dopbsp_reservations
);
Then see what you get in this object:
<?php
echo '<pre>';
print_r($my_results);
echo '</pre>';
Warning: Methods in the wpdb() class should not be called directly.
Use the global $wpdb object instead! Class Reference/wpdb
So, it’s better to make $wpdb
global:
global $wpdb;
$my_results = $wpdb->get_results(..................);
Notice: I didn’t checked the query itself.