Title: Function Development
Last modified: August 22, 2016

---

# Function Development

 *  [Jamie Gill](https://wordpress.org/support/users/patchgill/)
 * (@patchgill)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/function-development/)
 * 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 at acceptable to run a database
   call more than once in a function? I am more thinking on Security issues as Im
   not too familiar with this. 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 ‘Function Development’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

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

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
