If you want to carry out special analyses or evaluations or if your website is temporarily unavailable, you may want to query your course bookings from the database. We will show you how to do this and give you an example query. In this article you will find the following sections:
Preparation: Log in to your database
To start a query you must first log in to your database. Most hosting providers allow you to access your database via phpMyAdmin.
Please log in to your hosting provider and navigate to your database. Log in there.
Example: Query today's course bookings
To start an SQL query in your database, please click on the “SQL” tab in the upper area within phpMyAdmin. Once you get there, you will be presented with a text field where you can enter and submit the following query:
SELECT `wp_cbs_bookings`.date, start, end, post_title, `wp_cbs_bookings`.user_id, `wp_users`.display_name, `wp_users`.user_email FROM `wp_cbs_bookings` JOIN `wp_cbs_data` ON(`wp_cbs_bookings`.course_id = `wp_cbs_data`.id) JOIN `wp_posts` ON(`wp_cbs_data`.post_id = `wp_posts`.ID) JOIN `wp_users` ON(`wp_cbs_bookings`.user_id = `wp_users`.ID) WHERE `wp_cbs_bookings`.date = CURDATE();
Note: The wp_ prefix may be different for you. Depending on your configuration, you may have an individual database prefix. If this is the case, please replace wp_ with your prefix.
The result of your query looks something like this: