title: Basic SQL Select Statement Formatting in PHP
body: <p>I have a searchable database of the House and Senate and I just want to make a simple web page that can search this database. The only problem is, while I'm comfortable writing SQL select statements, how do I properly format them for use in PHP?</p>
  
  <p>For example, here's my radio button to select Senators by state:</p>
  
  <pre><code>$sql = "";
  if ($_POST['pkChamber'] == "Senate") {
      if ($_POST['pkParty'] == "Y") {
          $sql = SELECT * FROM senateinfo
                 WHERE state =  (Variable = "stname")
                 ORDER BY last_name, first_name');
      }
      else
      {
          $sql = SELECT * FROM senateinfo
                 WHERE state =  (Variable = "stname")
                 ORDER BY last_name, first_name
      }
  }
  </code></pre>