title: Can I use "array" to store the return record of SQL Select statement?
body: <p>I created a statement in PHP as below:</p>
  
  <pre><code>If ($stmt = $mysqli-&gt;prepare("SELECT mci FROM table1 WHERE id ='12343' ORDER BY date DESC LIMIT 2")) {
  $stmt-&gt;execute();
  $stmt-&gt;bind_result($col1);
  while ($stmt-&gt;fetch()) {
      }
  $stmt-&gt;close();
  $mysqli-&gt;close();
  </code></pre>
  
  <p>It should return 2 records. How can I store the 2 records using array? Should I use Array?</p>
  
  <p>And the 2 records will be do the comparsion. </p>
  
  <pre><code>if ($col1 &lt;&gt; $par1){   &lt;--- now it only compare the return record 1! 
  ......
  } 
  </code></pre>
  
  <p>The question is how can I compare the 2 records to the variable($par1) at the same time? If any return record is not same as the $par1, it will do something. </p>
  
  <p>I NEED TO DO THAT IF THE $PAR1 IS NOT SAME AS THE RETURNED VALUE, THE PROGRAM WILL CARRY OUT A PROPER ACTION! I HAVE NO IDEA HOW TO DO THIS. MY IDEA IS IT LETS STORE THE RETURNED VALUE TO ARRAY, AND COMPARE THE $PAR1 TO THE ARRAY. CAN I DO THAT?</p>
  
  <p>Thanks a lot.</p>