title: getting specific data from wordpress database table
body: <p>I am trying to use WordPress logged in user id which should search <code>transaction_user_ID</code> in the table <code>wp_m_subscription_transaction</code>.</p>
  
  <p>The table has a column called <code>transaction_user_ID</code> and another called <code>transaction_paypal_ID</code>.</p>
  
  <p>logic:if user id == transaction user id then get transaction paypal id </p>
  
  <p>which should be passed to the url  along with the user id email address 
  and the execute the url to get the a code - this is my final output  </p>
  
  <p>How this can be achieved?</p>
  
  <p>The code which I am developing is like this  which is  obviously incomplete &amp; error for the getting and using the database query</p>
  
  <pre><code>&lt;?php $user_id = get_current_user_id();
         $query = "SELECT * FROM $wpdb-&gt;;wp_m_subscription_transaction 
  
         if ($user_id ==$query) {
           &lt;a href="http://primary.copyminder.com/cm_prodkey.php?DID=********&amp;Password=*****&amp;ProdCode=*******&amp;NumRequired=1&amp;TransNum=(GET THIS FROM DATABASE) &amp;CustEmail=". $current_user-&gt;user_email ."&gt;Get ur Code&lt;/a&gt;
     } 
  else {
  echo 'You are not logged in as user ';}?&gt;
  </code></pre>