<?php
require_once('db.php');
// Create connection
//$conn = mysqli_connect($servername, $username, $password, $dbname);
$conn = new mysqli($servername, $username, $password, $dbname);

mysqli_set_charset($conn,'utf8');
	

$mobile=trim($_POST['mobile']);
$name=trim($_POST['name']);
$date_time=trim($_POST['date_time']);
$point=trim($_POST['point']);
$payment_type=trim($_POST['payment_type']);
$mail=trim($_POST['mail']);
$userID=trim($_POST['userId']);


  $sql = "INSERT INTO `withdrow`(`mobile`, `name`, `date_time`,`point`,`payment_type`,`mail`,`status`,`userId`) VALUES ('$mobile','$name','$date_time','$point','$payment_type','$mail','Pending','$userID')";
  $run = mysqli_query($conn,$sql);
    
if($run==true){


        $res->success = 'Withdraw Successfully';
       echo json_encode($res);
 }
else{
      echo "Failed";
    }


   


?>