Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_awpcp_ads() {
- global $wpdb;
- $awpcp_ads_table_name = $wpdb->prefix . 'awpcp_ads';
- $awpcp_adphotos_table_name = $wpdb->prefix . 'awpcp_adphotos';
- $latest_8_ads = $wpdb->get_results($wpdb->prepare(
- "
- SELECT DISTINCT $awpcp_ads_table_name.ad_id, $awpcp_ads_table_name.ad_title, $awpcp_adphotos_table_name.image_name
- FROM $awpcp_ads_table_name INNER JOIN $awpcp_adphotos_table_name
- ON $awpcp_ads_table_name.ad_id = $awpcp_adphotos_table_name.ad_id
- AND $awpcp_ads_table_name.disabled = %d
- GROUP BY $awpcp_ads_table_name.ad_id
- ORDER BY $awpcp_ads_table_name.ad_id DESC
- LIMIT 8
- ",
- array(0)
- ));
- return $latest_8_ads;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement