<?php

define ('DB_HOST','localhost');
define ('DB_NAME', 'ranbasera');
define ('DB_USER', 'root');
define ('DB_PASS', 'sqlMedia0r1gin');
function connectDB ()
{
        $link = mysqli_connect(DB_HOST, DB_USER, DB_PASS);
        if (!$link)
        {
            die('Could not connect: ' . mysqli_connect_error());
        }
        //mysql_select_db(DB_NAME, $link);
        mysqli_select_db($link, DB_NAME);
        return $link;
}   


function add($plan, $gateway, $key, $code, $orderId, $mobile, $amount)
{
        $link = connectDB ();
        $query = "insert into WebhooksLogs(plan, gateway, paymentKey, code, orderId, mobile, amount) values('$plan', '$gateway', '$key',  '$code', '$orderId', '$mobile',  '$amount')";
		echo $query;
        $result = mysqli_query($link, $query);
    if ($result != NULL)
        return true;
    else
        return false;
}

?>
