title: Getting a value from my sql database in Javascript?
body: <p>I've been having a bit of trouble with this for a while, please can somebody shed some light onto this? </p>
  
  <p>What's happening so far: When a button is clicked, a search statement occurs and an AJAX call is made and brings back a set of results (displayed as a table) these results coming from a table in mysql database called 'ticket. The values displayed from the ticket table are 'venue' 'date' 'time' 'tPrice'.
  This 'tPrice' is a number which has been set i.e. 15/20/25 to represent the price of a ticket. This works and displays fine but I'm having a problem trying to get the value of the price of the ticket in Javascript, does anyone know how to refer to a number in a mysql table in JS?</p>
  
  <p>What I'm wanting to do with this value is multiply it to the value of whatever number is selected from a drop-down menu. (this drop-down menu is also returned by AJAX as part of the  results of the user's search, this search result page is written in php and echoes the drop-down menu as a column within the results table)</p>
  
  <p>What I have so far is this:</p>
  
  <pre><code>function quantityChange() {
  //Select the value of the drop down list       
  var quantity = $('.summary').html($('#showQuantity option:selected').val());
  //get the value of the number from the tPrice column in 'ticket' table
  var ticket = parseFloat($('#ticketprice').val());
  //multiply them together
  var total = quantity * ticket;
  return (total);
  </code></pre>
  
  <p>After debugging in Firebug, it's giving me no errors but it's also not giving me any results...please, any help would be greatly appreciated! Thanks</p>
  
  <p>EDIT:
  The php code:</p>
  
  <pre><code>$postCodeSQL = "SELECT * FROM ticket WHERE locationID IN (SELECT locationID FROM location WHERE postCode LIKE '$pcSearch') ";
  
    $postCoderesult = mysql_query($postCodeSQL) or die(mysql_error());
  
    while ($pcRow = mysql_fetch_assoc($postCoderesult)) {
      $venue = $pcRow['venue'];
      $ticketPrice = $pcRow['tPrice'];
      $date = $pcRow['date'];
      $time= $pcRow['time'];
  
      echo "&lt;tr&gt;\n";
      echo "&lt;td&gt;$venue&lt;/td&gt;\n";
      echo "&lt;td id=\"ticketprice\"&gt;&amp;pound$ticketPrice&lt;/td&gt;\n";
      echo "&lt;td &gt;
           &lt;select name =\"showQuantity\" id=\"showQuantity\" class =\"showQuantity\" onchange=\"quantityChange()\" &gt;
                     &lt;option value=\"1\"&gt;1&lt;/option&gt;
             &lt;option value=\"2\"&gt;2&lt;/option&gt;
             &lt;option value=\"3\"&gt;3&lt;/option&gt;
             &lt;option value=\"4\"&gt;4&lt;/option&gt;
             &lt;option value=\"5\"&gt;5&lt;/option&gt;
           &lt;/select&gt;
          &lt;/td&gt;\n";
       echo "&lt;td&gt;$date&lt;/td&gt;\n";
       echo "&lt;td&gt;$time&lt;/td&gt;\n";
       echo "&lt;/tr&gt;\n";
  }
  </code></pre>