title: Nested looping with mysqli and fetch_object
body: <p>I'm attempting to do a comparision between two tables. If I find a match, I need to copy data from one table and insert it into the other. I'm able to pull the data from the tables just fine, but I'm having issues with a nested loop I created. It only loops through and finds one result. When looking through the tables, there are 1000s of matches, so I assume I'm doing something wrong. My only guess is the use of fetch_object and how I'm using it. I attempted using fetch_assoc instead, but I get the same result:</p>
  
  <pre><code>$mysqli = mysqli_connect("127.0.0.1", "uname", "pword") or die("Can't connect to databse!");
  mysqli_select_db($mysqli, "db_name") or die("Couldn't Select Database!");
  
  $result = $mysqli-&gt;query('SELECT * FROM table_1');
  $title = $mysqli-&gt;query('SELECT title FROM table_2');
  
  if($result &amp;&amp; $title){
  
     while($t_row = $title-&gt;fetch_object()){
  
        while($row = $result-&gt;fetch_object()){
  
           $s_title = strtolower($t_row-&gt;title);
           $m_title = strtolower($row-&gt;description);
  
           if($s_title == $m_title) {
              echo "Matched: $s_title &lt;strong&gt;with&lt;/strong&gt; $m_title&lt;br /&gt;";
              break;
           }
  
        }
  
     }
  }
  </code></pre>