MySql Query For WordPress

I want to edit a WordPress plugin. My code is below. The parts in which I’m stuck is documented in the code. Could you show me the correct way to write the code please?


global $wpdb; //I think this is correct
//I need help to convert the 2 lines below to a WordPress friendly query
$query1="SELECT * FROM wp_users WHERE user_login LIKE '%z%'"; 
$result1 = mysql_query($query1);
//I want to put the search results into the example below
if ( $user_login == 'admin' || $user_login == 'joe' ) {

Source: wordpress

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.