title: sql query in php not working
body: <p>I am trying to make a sql query call in my php file and this is my code:</p>
  
  <pre><code>&lt;?php
  $program = $_GET["program"];
  $school = $_GET["school"]; 
  $term = $_GET["term"];
  $extension = $_GET["extension"];
  
  $con = mysql_connect("127.0.0.1","root","");
  if (!$con)
  {
   die('Could not connect: ' . mysql_error());
  }
  
  mysql_select_db("csv_db", $con);
  $sql = "SELECT * FROM tbl_name WHERE Dep1= '" . $program . "' AND Dep2= '" . $school . "' AND Dep3= '" . $term . "'";  
  $result = mysql_query($sql)  or die(mysql_error());
  echo $sql;
  
  echo "&lt;table id='booklist'&gt;&lt;tr&gt;
                           &lt;th&gt;Edit&lt;/th&gt;
                           &lt;th class='coursename'&gt;Course Name&lt;/th&gt;
                           &lt;th class='startdate'&gt;Start Date&lt;/th&gt;
                           &lt;th class='booktitle'&gt;Book Title&lt;/th&gt;
                           &lt;th class='author'&gt;Book Author&lt;/th&gt;
                           &lt;th class='isbn'&gt;Book ISBN&lt;/th&gt;
                       &lt;/tr&gt;";
          while($row = mysql_fetch_array($result))
          { 
              echo    "&lt;tr&gt;
                          &lt;td&gt;&lt;input type='checkbox'&gt;&lt;/input&gt;&lt;/td&gt;
                          &lt;td class='coursename'&gt;" . $row['Course Name'] . "&lt;/td&gt;
                          &lt;td class='startdate'&gt;" . $row['Start Date'] . "&lt;/td&gt;
                          &lt;td class='booktitle'&gt;" . $row['Book Title']. "&lt;/td&gt;
                          &lt;td class='author'&gt;" . $row['Book Author']. "&lt;/td&gt;
                          &lt;td class='isbn'&gt;&lt;input class='ISBN_number' type='text' value='' size='13' maxlength='13'&gt;&lt;/input&gt;&lt;/td&gt; 
                    &lt;/tr&gt;";                   
          }               
  echo "&lt;/table&gt;";
  
  mysql_close($con);
  ?&gt; 
  </code></pre>
  
  <p>This  sql is supposed to populate a html table which will be sent back to an ajax call. For some reason its not working. When I used a plain "Select * from tbl_name" the table worked perfectly fine. When I tried adding in some parameters it stopped working. All that shows up now is the headers (but not in table form). I did an echo of the call and the parameters are being imported to the php correctly and I checked to make sure that the column names are as I wrote them.</p>