Support » Plugins » 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

  • The topic ‘Function Development’ is closed to new replies.