Title: General Question
Last modified: August 22, 2016

---

# General Question

 *  [Jamie Gill](https://wordpress.org/support/users/patchgill/)
 * (@patchgill)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/general-question-12/)
 * Hi Guys,
 * I am currently working on building a function using global $wpdb to select some
   values to add into a hook using add_filter. Is it acceptable to run a database
   call more than once in a function? I am more thinking on Security issues. The
   code I am starting with is :-
 *     ```
       global $wpdb;
   
       $postinfo = $wpdb->get_results( "SELECT * FROM ls_posts WHERE ID = '$postid'", OBJECT );
       $postimage = $wpdb->get_results( "SELECT * FROM ls_posts WHERE post_parent = '$postid'", OBJECT );
       ```
   
 * Any information would be greatly appreciated
    Many Thanks J

The topic ‘General Question’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [Jamie Gill](https://wordpress.org/support/users/patchgill/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/general-question-12/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
