function xselect( $table, $form = 0, $to = 9999 ){ return "SELECT {$table}.ID, {$table}.price,{$table}.model,{$table}.make, concat(make, ' ', model) AS makemodel FROM {$table} INNER JOIN wp_posts ON {$table}.ID = wp_posts.ID ORDER BY makemodel ASC LIMIT {$form}, {$to}"; } function xget_results( $table, $form, $to ){ global $wpdb; return $wpdb->get_results( xselect( $table, $form, $to ) ); }
Leave a Reply