call a function and add a database table in sql

//************call a function and  add a database table in sql********


function writeapilog($request,$response,$ipaddress,$apiMethod,$type,$uname)
{

    try
    {
        $dateTimeData =date('Y-m-d H:i:s');
        //$apiuser= addslashes(json_decode($apiuser));
        //$apikey= addslashes(json_decode($apikey));
        $request= addslashes(json_decode($request));
        //$response1= json_decode($response);
        $ipaddress= addslashes(json_decode($ipaddress));
        //$descr= addslashes(json_decode($descr));
        $insLogData ="INSERT INTO `Mobicubes`.`apilogs` (`apilogid`,`username`, `apilogdttm`, `request`, `response`,                 `ipaddress`, `descr`, `logtype`) VALUES (NULL, '$uname','$dateTimeData', '$request', '$response', '$ipaddress', '', '$type')";
        $rr=mysql_query($insLogData);
        $selectData = $rr;
        $countData = $var->num_rows($selectData);
        mysql_query($insLogData);
    }
    catch(PDOException $e)
    {
        $d1 = '{"error":{"text":' . $e->getMessage() . '}}';
   
    }       
}
Share on Google Plus

About quora Questions & Answers A-Z

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment