title: Get variable from URL with Jquery Refresh
body: <p>I am doing a jquery refresh on a div containing a mysql query. The query however needs to grab a variable from the URL. It works, but as soon as it does the refresh it stops grabbing the variable and thus the query doesn't work. </p>
  
  <p>Here is my refresh code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var auto_refresh = setInterval(
  function ()
  {
  $('#records').load('user_records.php').fadeIn("slow");
  }, 30000); // refresh every 30 seconds
  &lt;/script&gt;
  </code></pre>
  
  <p>and then my basic query...</p>
  
  <pre><code>    $username = $_GET['user'];
      echo $username; //for testing
      echo "&lt;div id='records'&gt;&lt;h1 align='center'&gt;Today's Transfers&lt;/h1&gt;
      &lt;table cellspacing='0' cellpadding='0'&gt;
      &lt;tr&gt;
      &lt;th&gt; Customer Name&lt;/th&gt;&lt;th&gt;Phone Number&lt;/th&gt;&lt;th&gt;Disposition&lt;/th&gt;&lt;th&gt;DID&lt;/th&gt;&lt;th&gt;Date Called&lt;/th&gt;
      &lt;/tr&gt;
      ";
  $sql = "SELECT * FROM users WHERE username = '$username'";  
      $result = mysqli_query($link, $sql, MYSQLI_STORE_RESULT);
  while($row = $result-&gt;fetch_assoc()){
          $user_id = $row['id'];
  }
  </code></pre>
  
  <p>followed by echoing my results, etc, etc.
  The query gets the username and works when the page load, but when it does the refresh it stops getting ther $username variable, even though it is still in the url. Is there a way to keep getting the variable each time? Thanks for any help!</p>