How do I make custom query with WordPress?

I need to make a query in a WordPress plugin but I couldn’t find a WordPress function and I’m not sure is right to use mysql_query

The functions I’ve found enable ordering and grouping but I need to use also join and in (list).

Read More

Is there a way?

Related posts

Leave a Reply

2 comments

  1. It looks like you’d want to use the $wpdb class (which has functions for directly accessing and manipulating the wordpress database). It lets you do things like:

    <?php $wpdb->query('select * from my_plugin_table where foo = "bar"'); ?>
    

    Documentation here.