global $wpdb;
$table_name1 = $wpdb->prefix .
's2p_member_questions';
$table_name = $wpdb->prefix .
's2p_member_uploads';
$table_name12 = $wpdb->prefix .
's2p_scheduling';
$rows2 = $wpdb->get_results(
$wpdb->prepare( "SELECT * from
$table_name1
inner join $table_name12 on
$table_name12.schid = $table_name1.m_id
inner join $table_name on
$table_name.mid = $table_name1.m_id
where mediatype = %s order by mop_rating desc limit
$lim
","video"), ARRAY_A
);
//check print_r($rows2)
Foreach($rows2 as $value)
{echo $value[‘’];
}?>
EmoticonEmoticon