title: select * from table where name like %O%
body: <p>In phpMyAdmin the query </p>
  
  <pre><code>SELECT * FROM table WHERE value1 LIKE '%O%' OR value2 LIKE '%1%'
  </code></pre>
  
  <p>nicely returns all rows containing O or 1.</p>
  
  <p>But the same query implemented in a PHP script only returns the first row matching O or 1. Instead off all rows matching O or 1.</p>
  
  <p>This is my current PHP script:</p>
  
  
  
  <pre><code>mysqli_select_db ($con, $database) or die (mysqli_error());
  
              $sqli = mysqli_query ($con,"SELECT * FROM table WHERE VALUE1 LIKE '%O%' OR VALUE2 LIKE '%1%'") or die (mysqli_error()); 
  
              $echo = mysqli_fetch_assoc($sqli);
  
              if (empty ($echo))
              {
                  echo "No matching results found.";
              }
              else
              {
                  echo "&lt;table width='50%' border='1'&gt;";
                  echo "&lt;tr&gt;&lt;th&gt;VALUE1&lt;/th&gt;&lt;th&gt;VALUE2&lt;/th&gt;&lt;/tr&gt;";
                  echo "&lt;tr&gt;&lt;td&gt;{$echo["VALUE1"]}&lt;/td&gt;";
                  echo "&lt;td&gt;{$echo["VALUE2"]}&lt;/td&gt;&lt;/tr&gt;";
              }
  </code></pre>
  
  <p>The output is only the first matching row. Instead of all matching rows.
  Also when I use print_r instead of table rows.</p>