Before anything appears in your thoughts, please understand that i'm very a new comer to PHP and to tell the truth, I'm depending solely on stack overflow to construct my easy and first php web application.

I'm looking to get the information from the query string and store it during my database. I would like anyone to write a brief bit of code to check on if the string is available and when it will, combine it with my database. I'm using wordprss and so i think we are able to use $_GET and $wpdb but i'm not sure the syntax. The url with querystring is one thing like: http://www.mydomain.tld/?publishid=1235ABC

Something similar to this could see if the publishid is available within the GET variable. The relaxation is dependent which database you're using, and give me an idea to complete whether it does not exist.

if(!isset($_GET['publishid']))
{
       //Do whatever you want if the key does not exists
}
else
{
//Insert into the database.  
}

Based on given address http://www.mydomain.tld/?publishid=1235ABC it might be something similar to below::

    <?php
       $input = isset($_GET['publishid']) ? $_GET['publishid'] : '';
       if(!empty($input)) {
          $query = "INSERT INTO table (input_field) VALUES ('$input')";
          mysql_query($query);
       }
    ?>