Answer the question
In order to leave comments, you need to log in
How to generate SQL from this wp_query?
$query = new WP_Query(array
(
'post_type'=>mec_books,
'posts_per_page'=>-1,
'post_status'=>array('publish', 'pending', 'draft', 'future', 'private'),
'year'=>2020,
'monthnum'=>05,
'day'=>20,
'meta_query'=>array
(
array('key'=>'mec_event_id', 'value'=>$event_id, 'compare'=>'='),
array('key'=>'mec_ticket_id', 'value'=>$ticket_id, 'compare'=>'='),
array('key'=>'mec_verified', 'value'=>'-1', 'compare'=>'!='), // Don't include canceled bookings
)
));
Answer the question
In order to leave comments, you need to log in
echo "Last SQL-Query: {$query->request}"; Decided so. Thanks Dmitry
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question