title: Calling value from Database
body: <p>I am trying to get value of <em>'price'</em>(column name)from <em>services</em>(table name) to insert into amount var in the script below.</p>
  
  <p>Any help would be appreciated.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var amount       = '100.00';  //need to insert amount here for each user before making payment
      var currency     = 'USD';   // 
      var discount     = '0.00';//  
  </code></pre>
  
  <p></p>
  
  <p>services(table structure)
  5 columns</p>
  
  <blockquote>
    <p>s_id  |  name  |  price  |  discount  |  delete</p>
  </blockquote>
  
  <p>Here's what I've tried after the comment of @Zanderwar</p>
  
  <pre><code>&lt;?php
  
  include '../with_session.php';
  include '../db-connection.php';
  session_start();
  $id=$_SESSION['id'];
  
  $sid="SELECT s_id WHERE id='$id'";  //to get s_id coloumn value
  $resultsid=mysqli_query($con, $sid);
  $rowid=mysqli_fetch_assoc($resultsid);
  
  
  $qamount= "SELECT price FROM services WHERE s_id='.$resultsid'";// selecting price to insert into    amount
  $resultq= mysqli_query($con, $qamount);
  $row_data = mysqli_fetch_assoc($resultq);
  
  $row_data=$resultq;
  
  ?&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;link rel="stylesheet" href="https://www.paytabs.co/theme/express_checkout/css/express.css"&gt;
      &lt;script src="https://www.paytabs.co/theme/express_checkout/js/jquery-1.11.1.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
   &lt;!-- Button Code for PayTabs Express Checkout--&gt;
  &lt;div class="checkout"&gt;    
  &lt;script type="text/javascript"&gt;
      var amount       =  '&lt;?=$row_data['amount']?&gt;'; //'100.00';  //
      var currency     = 'USD';   //3-character ISO Currency Code e.g: USD 
      var discount     = '0.00';// Optional Field 
      var title        = 'Test Express Checkout Transaction'; // Title of your transaction 
  
  &lt;/script&gt; )
  </code></pre>