| @@ -32,17 +32,17 @@ | ||
| 32 | 32 | $search = isset( $_REQUEST['q'] ) ? esc_sql( $wpdb->esc_like( $_REQUEST['q'] ) ) : ''; |
| 33 | 33 | $table = $wpdb->prefix . ( defined( 'WPEP_DB_TABLE_COURSE_SECTION_LESSON' ) ? WPEP_DB_TABLE_COURSE_SECTION_LESSON : 'wpep_section_lesson' ); |
| 34 | 34 | |
| 35 | 35 | if ( ! empty( $search ) ){ |
| 36 | - $lessons = $wpdb->prepare( | |
| 36 | + $lessons = $wpdb->get_results( $wpdb->prepare( | |
| 37 | 37 | "SELECT * FROM {$table} |
| 38 | 38 | WHERE ( title LIKE %s OR title LIKE %s ) |
| 39 | 39 | ORDER BY post_id ASC, order ASC", |
| 40 | 40 | "%%{$search}%%", |
| 41 | 41 | "{$search}%%" |
| 42 | - ); | |
| 42 | + ) ); | |
| 43 | 43 | } else { |
| 44 | - $lessons = "SELECT * FROM {$table} ORDER BY post_id ASC, order ASC"; | |
| 44 | + $lessons = $wpdb->get_results( "SELECT * FROM {$table} ORDER BY post_id ASC, order ASC" ); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | // Build the results array |
| 48 | 48 | $results = array(); |