Title: Is get_results Already Escaped?
Last modified: August 22, 2016

---

# Is get_results Already Escaped?

 *  [AMcCarrick](https://wordpress.org/support/users/amccarrick/)
 * (@amccarrick)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/get_result/)
 * Question regarding the get_results method on the wpdb class…
 * Is the query entered into the get_result method escaped by get_results or should
   I be placing a call to the prepare method inside of get_results?
 * `$wpdb->get_results($sql);`
 * or
 * `$wpdb->get_results($wpdb->prepare($sql));`
 * Digging through the wpdb class file it seems like no, but would like some assurance.

Viewing 1 replies (of 1 total)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/get_result/#post-5171340)
 * You are right. You need to parepare the query string before it goes to get_results.
   Using `$wpdb->prepare()` as you are there is the right way to do it.

Viewing 1 replies (of 1 total)

The topic ‘Is get_results Already Escaped?’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/get_result/#post-5171340)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
