title: Is there a simple way to repeat a php mysql query?
body: <p>I'm hoping there's a little trick to php that will save me 100's of copy>paste>change-number - thanks for taking a look!</p>
  
  <p>I've got a relatively large dataset in a MySQL db.</p>
  
  <p>There are just two columns: Models (about 7000 unique entries) and Manufacturers (about 100 unique ones, i.e. the models are from just 100 different manufacturers)</p>
  
  <p>At the moment (well, as I am writing the very slow, repetitious way), I have a huge list of PHP database queries along the lines of:</p>
  
  <blockquote>
    <p>$result = mysql_query("SELECT * FROM products WHERE manufacturer ='3M'" );<br />
    while ($row = mysql_fetch_array($result)) {<br />
    echo $row['manufacturer'] . " " . $row['model']; }</p>
  </blockquote>
  
  <p>What I'm doing is working, but is there perhaps a way of getting a list of all manufacturers then running the php above on the list? </p>
  
  <p>Or maybe something different I haven't thought about?</p>
  
  <p>Thanks heaps,</p>
  
  <p>(The actual outputting is done into a javascript accordian - so displaying it on a single page isn't an issue) </p>