• Hello Everyone,

    I am looking to query an additional database with a plugin that will pull out values and assign them to short codes. What I have built is currently working beautifully, but I want to make sure this thing doesn’t blow up in my face. I have added the code below and I was hoping I could get some confirmation that what I have done will continue to work.

    $con = mysql_connect("HOST","USERNAME","PASSWORD");
    
    if (!$con){
        die('Could not connect: ' . mysql_error());
    }
    
    mysql_select_db("DB_NAME", $con);
    mysql_set_charset('utf8',$con);
    
    function regContentGetterv3(){
        $regQ = "SELECT post_content FROM wp_posts WHERE post_title='$_GET[wver]' ORDER BY ID DESC LIMIT 0,1";
        $regQBOOM = mysql_query($regQ);
        $regContent = mysql_result($regQBOOM, 0);
        return $regContent;
    }
    add_shortcode('regcontentcodev3', 'regContentGetterv3');

The topic ‘Querying an Additional Database for Shortcode Values’ is closed to new replies.