title: Loop through mysql table row and check if any column matches a set number in php
body: <p>Im trying to loop through a mysql table and check if a row contains the number I specify:</p>
  
  <p>Here is what I have:</p>
  
  <p>mysql table with numbers:</p>
  
  <p>mysql table:</p>
  
  <pre><code>no1|no2|no3|no4|no5
   1   3   5   2   6
   4   7   8   9   8
   2   6   9   1   0
   ...
  </code></pre>
  
  <p>For Example: I have number 
  4 5 3 7</p>
  
  <p>So in the first row i should get a total of 2 as there are numbers 3 and 5 first row and this numbers are in the number I have specified.</p>
  
  <p>In the second row I should get a total of 1 as only a 4 is in the row and the number i have specified.</p>
  
  <p>And in the last row total should be 0 as there are no matches.</p>
  
  <p>I hope its clear. </p>
  
  <p>I have tried the following but it dont work I hope someone can help me work it out thanks in advance.</p>
  
  <pre><code>$lottono1=4;
  $lottono2=5;
  $lottono3=3;
  $lottono4=7;
  
  $no1 = 0;
  $no2 = 0;
  $no3 = 0;
  $no4 = 0;
  
  do { ?&gt;
  // i done the following if code for each numbers but
  //putting this only to take less space
  
  if (($row_Recordset1['no1']=$lottono1) || ($row_Recordset1['no1']=$lottono2) || ($row_Recordset1['no1']=$lottono3) || ($row_Recordset1['no1']=$lottono4)) {
        $no1=1;
  
    } 
  
  while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
  </code></pre>