MySQL query to select events between start/end date

I have a MySQL table named ‘events’ that contains event data. The important columns are ‘start’ and ‘end’ which contain string (YYYY-MM-DD) to represent when the events starts and ends. I want to get the records for all the active events in a time period. Events: —————————— ID | START_DATE | END_DATE | —————————— 1 […]

Read More

How To Get Posts Category In WordPress

Problem Can we get the list of blog posts in the following structure? Published Date Author Category Post Title Blog URL Solution 1 2 3 4 5 6 7 8 9 10 SELECT p.ID,DATE(p.post_date) Date,u.display_name Author,p.post_title Title,GROUP_CONCAT(t.name) Category, CONCAT(‘http://yourdomain.com/blog/’,p.post_name) URL FROM wp_posts p LEFT JOIN wp_users u ON p.post_author = u.ID LEFT JOIN wp_term_relationships rel ON rel.object_id = […]

Read More

Get featured image url direct using mysql query in wordpress

As  we know that there are various method through which we can display featured image in frontend but sometime we need to add some contents or add blog on another site then at that time there does not work wordpress query neither wordpress functions. so that we use mysql query to display wordpress blog data […]

Read More

How to manage MySQL databases and users from the command line

CREATING USERS AND DATABASES To create a MySQL database and user, follow these steps: At the command line, log in to MySQL as the root user: mysql -u root -p Type the MySQL root password, and then press Enter. To create a database user, type the following command. Replace username with the user you want to create, […]

Read More