views:

1430

answers:

3

Hi, 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)

is there a way?

thank you

+2  A: 

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.

inkedmn
thank you :-Dthat's what i was looking forhttp://codex.wordpress.org/wpdb
A: 

Hello thanks .. .

sesli panel
A: 

To pull out rows maybe you'd use:

$myrows = $wpdb->get_results( "SELECT id, name FROM mytable" );
Paamayim