} logToFile("aa"); $Uid = $_POST["Uid"]; $email = $_POST["email"]; $phone = $_POST["phone"]; $helpdId = $_POST["helpId"]; $requestdate = $_POST["requesteddate"]; $place1 = $_POST["location1"]; $place2 = $_POST["location2"]; $message = $_POST["message"]; $address = $_POST["address"]; $education = $_POST["education"]; $latitide = $_POST["lat"]; $logitude = $_POST["long"]; $duration = $_POST["duration"]; InsertBenificiaryData($Uid, $email, $phone, $helpdId, $requestdate, $place1, $place2, $address, $message, $education, $latitide, $logitude, $duration); function InsertBenificiaryData($Uid1, $email1, $phone1, $helpdId1, $requestdate1, $place1, $place2, $address1, $message1, $education1, $latitide1, $logitude1, $duration1) { try { $host = "localhost"; $user = "******"; $pass = "******"; $database = "blinx"; logToFile($database); $conn = mysqli_connect($host, $user, $pass, $database) or die("Error " . mysqli_error($link)); $sql2 = "select COALESCE(MAX(Id), 0) as MaxID from t_help_request"; logToFile($sql2); $result = mysqli_query($conn, $sql2); if (!$result) { logToFile("Failed"); echo 'Failed Registration';
<?php date_default_timezone_set('Asia/Kolkata'); $firstname = $_POST["firstname"]; $lastname = $_POST["lastname"]; $email = $_POST["email"]; $phone = $_POST["phone"]; $pwd = $_POST["paswd"]; $place1 = $_POST["latitude"]; $place2 = $_POST["longitude"]; InsertBenificiaryData($firstname, $lastname, $email, $phone, $place1, $place2, $pwd); function logToFile($msg) { try { $filename = '\\wamp\\www\\log.txt'; // open file $fd = fopen($filename, "a"); // append date/time to message $str = "[" . date("Y/m/d h:i:s", time()) . "] " . $msg; // write string fwrite($fd, $str . "\n"); // close file fclose($fd); } catch (Exception $e) { logToFile($e->getMessage()); } } function InsertBenificiaryData($firstname1, $lastname1, $email1, $phone1, $place1, $place2, $pwd) { $host = "localhost"; $user = "******";