title: Live jquery sql select
body: <p>Hello im new to jquery but i need to do a sql select and get a number from the db.
  ill try and explain better i do a sql select</p>
  
  <pre><code>    $sql = "SELECT * FROM `livebattle` WHERE `username` = '" . $_SESSION['username'] . "'";
          $result = mysql_query($sql) or die(mysql_error());
          $values = mysql_fetch_array($result);
  
  echo $values['livebattle'] ;
  </code></pre>
  
  <p>Im trying to make a live battle script. So the user sends the request and then livebattle= 0 if the user accept the battle it will turn into 1. The user has to keep refreshing the page to keep doing the select. So if the user aceppts the battle the vale becomes 1 but the user has to refresh the page to do the select again.</p>
  
  <p>So i need a way of doing the select in jquery so when livebattle turns into 1 when the user accepts the battle it will redirect the user to the battle with out refreshing the page.</p>