<?php
$conn = mysqli_connect("localhost", "root", "", "mydb"); // Database Connection
$data = json_decode(file_get_contents("php://input"));// Decoding data
echo '<pre>'; //Printing Array
print_r($data);
echo '</pre>';
//Getting values in variables
$ename = mysqli_real_escape_string($conn,$data->ename);
$eemail = mysqli_real_escape_string($conn, $data->eemail);
$ecompany = mysqli_real_escape_string($conn, $data->ecompany);
$edesignation = mysqli_real_escape_string($conn, $data->edesignation);
// Inserting values into Database
mysqli_query($conn, "INSERT INTO employee('name', 'email', 'companyName','designation') VALUES('".$ename."','".$eemail."','".$ecompany."','".$edesignation."')");
?>
Array Output is - stdClass Object([ename] => Rohit [eemail] =>xxxxxxx@gmail.com [ecompanyname] => Seven [edesignation] => Web & Graphic Designer)
Please help me , what can i do now ? What is stclass ??
Thanks alot