title: Passing form variable into Php Query
body: <p>I am trying to get a variable from a form on my page 1 into a query  I have made on page 2 so that when the query works it will use the variable entered on page 1</p>
  
  <p>Page 1 Form </p>
  
  <p><code>&lt;form method="post" action="testformQ.php"&gt;
    &lt;input type="text" name="testform"&gt;
    &lt;input type="submit"&gt;enter</code></p>
  
  <p>Page 2 Query</p>
  
  <pre><code>'$software = mysql_query("SELECT software.SoftwareID, rooms.RoomID 
      FROM softwareroom 
      INNER JOIN software 
      ON software.SoftwareID=softwareroom.SoftwareID 
      INNER JOIN rooms ON rooms.RoomID=softwareroom.RoomID 
      WHERE rooms.RoomNum=$_GET[testform]");              (the where clause is where i want the variable)
          while($rec = mysql_fetch_array($software))
          {
              echo $rec['SoftwareID'] . " " . $rec['RoomID'];
          }'
  </code></pre>
  
  <p>So where the GET testform is within the query is where I want the form variable to go.
  Any help would be appreciated thanks</p>