title: .ajax() Bad Request 400
body: <p>So I built the code for a web application on WAMP (my first time using any server stuff) and a test database we made looking at the client's databases.  When trying to implement, we have run into a lot of trouble.  They are using an enterprise server (NOTE: I have no idea what I am talking about here) and MSSQL where I just used localhost, root, and no password on WAMP with MYSQL.  I have no idea how to help them get the product implemented.  It works fine on my computer but for them, it says Bad Request 400 when I have AJAX print out the error text.</p>
  
  <p>ajax request</p>
  
  <pre><code>$.ajax({
          type: "GET",
          url: "getJobList.php",
          data: "hline="+lineLabel[currentLine],
          dataType: "json",
          success: function(data){
                //do successful stuff
          }
  }
  </code></pre>
  
  <p>php file</p>
  
  <pre><code>&lt;?php
  
  include "config.php";
  
  $con = mysql_connect($host);
  $dbs = mysql_select_db($databaseName, $con);
  //get the parameter from URL
  $hline=$_GET["hline"];
  if (empty($hline)){
      echo "1"; //default rate
  }
  else{
      $db=mysql_pconnect($host, $user, $pass);//connect to local database
      mysql_select_db($databaseName, $db);//select the database you want to use
      if (!$db){
          echo ("error connecting to database");              
      }
      else{
          //connection successful
          $sql = " SELECT partparameters.cspc,processingrate,setuptime,lotsize,duedate,duetime,homeline
          FROM jobs
          INNER JOIN partcoding 
          ON jobs.partnumber=partcoding.partnumber
          INNER JOIN partparameters
          ON partcoding.cspc=partparameters.cspc
          WHERE homeline = '$hline'
          ORDER BY duedate,duetime ASC";//sql string command
            $result=mysql_query($sql) or die (mysql_error());//execute SQL string command
            //result contains rows
            $arr = array();
            $num = 0;
            while($rows = mysql_fetch_array($result))
            {
              $array[$num] = $rows;
              $num++;
            }
            echo json_encode($array);
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>php config file</p>
  
  <pre><code>&lt;?php
  $host = "localhost";
  $user = "root";
  $pass = "";
  $databaseName = "gmdata1";
  ?&gt;
  </code></pre>
  
  <p>Any ideas? Thanks in advance!</p>
  
  <p>EDIT: Fixed a stray parenthesis that I mistyped when posting.  Also if it makes a difference I developed on Chrome and the Users are using Firefox.  I dont think it should make a difference though because they render the same.</p>
  
  <p>EDIT 2: </p>
  
  <blockquote>
    <p>Request URL:</p>
  </blockquote>
  
  <pre><code>http://usmmcsa0wwt01/ProdSched/getJobList.php?hline=G%20%201
  </code></pre>
  
  <blockquote>
    <p>Request Method:
       GET</p>
    
    <p>Status Code:
       HTTP/1.0 400 Bad Request</p>
    
    <p>Request Headers
       15:24:24.000</p>
  </blockquote>
  
  <pre><code>X-Requested-With:XMLHttpRequestUser-Agent:Mozilla/5.0 (Windows NT 6.1; rv:20.0) Gecko/20100101 Firefox/20.0Referer:http://usmmcsa0wwt01/ProdSched/index.phpHost:usmmcsa0wwt01Connection:keep-aliveCache-Control:max-age=0Accept-Language:en-US,en;q=0.5Accept-Encoding:gzip, deflateAccept:application/json, text/javascript, */*; q=0.01
  </code></pre>
  
  <blockquote>
    <p>Response Headers
       Δ2ms</p>
    
    <p>Server:CIMPLICITY-HttpSvr/1.0Date:Mon, 22 Apr 2013 19:24:24 GMT</p>
  </blockquote>
  
  <p>This is what I get in their firefox console inspect HTTP request</p>