title: payment details are not inserted in database
body: <p>i have a problem in storing payment details in my database after make a payment through paypal. here is the coding for payment success. it takes the value but the value is not stored in database. I use tmno as userID</p>
  
  <pre><code>&lt;?php
  session_start();
  include 'con.php';
  
  $cartID = $_SESSION['cartID'];
  $amount = $_GET['amt'];
  $currency = $_GET['cc'];
  $transactionID = $_GET['tx'];
  $payment_status = $_GET['st'];
  $invoice = mt_rand();
  
  $tmno = $_SESSION['tmno'];
  
  $insert_payment = "INSERT INTO payment (paymentID,cartID) VALUES
  ('$transactionID','$cartID')";
  $result_payment=mysqli_query($con,$insert_payment);
  
  if($result_payment){
      $update_query = "UPDATE cart SET status=1 WHERE cartID='$cartID' ";
      $update_result = mysqli_query($con,$update_query);
  
      if($update_result){
          $sql1 = "SELECT * FROM cart WHERE tmno='$tmno' AND status=0 ";
          $result1 = mysqli_query($con,$sql1);
  
          if(mysqli_num_rows($result1)&gt;0){
              $row1 = mysqli_fetch_array($result1);
              $cartID = $row1['cartID'];
          }
  
          else{ //if user doesn't have cart yet
              $sql2 = "INSERT INTO cart(tmno) VALUES ('$tmno') ";
              $result2 = mysqli_query($con,$sql2);
              $cartID = mysqli_insert_id($con);
          }
  
          $_SESSION['cartID'] = $cartID;
  
          echo "Your payment was successfully recorded!";
          echo "&lt;a href='UserFee.php'&gt;&lt;h3&gt;Click here to go back to the homepage!&lt;/h3&gt;&lt;/a&gt;";
      } else {
          echo "Oh no!";
      }
  }else {
      echo "Failed!";
  }
  
  ?&gt;
  </code></pre>
  
  <p>this is the configure.php</p>
  
  <pre><code>&lt;?php
  $con = mysqli_connect('DB_HOST', 'DB_USERNAME', 'DB_PASSWORD', 'DB_NAME') or die('Error Connect to DB');
  mysqli_query($con,'utf-8');
  ?&gt;
  </code></pre>
  
  <p>the error shown is</p>
  
  <p>Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'utf-8' at line 1' in /home/sptlabua/public_html/configure.php:3 Stack trace: #0 /home/sptlabua/public_html/configure.php(3): mysqli_query(Object(mysqli), 'utf-8') #1 /home/sptlabua/public_html/payment_success.php(5): include('/home/sptlabua/...') #2 {main} thrown in /home/sptlabua/public_html/configure.php on line 3</p>