title: How do I echo rows that have a specific variable in it from Database
body: <p>So first off my database table is set up like this:</p>
  
  <blockquote>
    <p>id | affsub | offer_name | date | time | payout</p>
    
    <p>1 | stringhere | offer | 2017-09-12 | 06:47:00 | 1</p>
  </blockquote>
  
  <p>and I want to to echo out all the rows that include the affsub stringhere into a html table. I have tried this:</p>
  
  <pre><code>&lt;?php
     $id = $get_info_id;
     $mysqli = new \mysqli('localhost', 'user', 'pass', 'db');
     $aff = $mysqli-&gt;query("SELECT affsub FROM users WHERE id = $id")-&gt;fetch_object()-&gt;affsub;
     $affsub = $aff;
     $userinfo= $mysqli-&gt;query("SELECT offer_name, time, payout FROM conversions WHERE affsub = ". $affsub . "");
  
    if ($userinfo-&gt;num_rows &gt; 0) {
       while($row = $userinfo-&gt;fetch_assoc()) {
          echo '&lt;tr&gt;
             &lt;td&gt;&lt;b&gt;&lt;color=black&gt;' .$row['offer_name'].' &lt;/b&gt;&lt;/td&gt;
             &lt;td&gt;&lt;color=black&gt;' .$row['time'].'&lt;/td&gt;
             &lt;td&gt;$&lt;color=black&gt;' .$row['payout'].'&lt;/td&gt;
          &lt;/tr&gt;';
       }
    }
    else {
       echo "&lt;b&gt;&lt;center&gt;No Conversions Have Happened.&lt;/center&gt;&lt;/b&gt;";
    }
  ?&gt;
  </code></pre>
  
  <p>and I know that it is getting the affsub because if i do echo $affsub my affsub is echoed out but nothing is shown on the table and im not sure whats happening.</p>