Hi once again, I've managed to get the Update and delete functions working in my PHP API along with showing all people in the database with the help of Aeric, DOnManfred, oparra etc the one last bit is the entry of a new person via my app and not the third party app.
I'm basically sending the following
<code>
"Action":"InsertPerson", "_sfm_form_submision_time_":mSQLDate, "Name":NameTF.Text,"Phone"
honeTF.Text,"Party"
artyTF.Text, "Email":EmailTF.Text
</code>
to the PHP code
<code>
Case "InsertPerson":
$pdate=stripslashes(mysqli_real_escape_string($con,$jsone["_sfm_form_submision_time_"]));
$pname=stripslashes(mysqli_real_escape_string($con,$jsone["Name"]));
$pphone=stripslashes(mysqli_real_escape_string($con,$jsone["Phone"]));
$pparty=stripslashes(mysqli_real_escape_string($con,$jsone["Party"]));
$pemail=stripslashes(mysqli_real_escape_string($con,$jsone["Email"]));
$stmt = $con->prepare("INSERT INTO login (_sfm_form_submision_time_, Name, Phone, Party, Email) VALUES (?, ?, ?, ?, ?)");
$rc=$stmt->bind_param("sss", $pdate, $pname, $pphone, $pparty, $pemail);
$rc=$stmt->execute();
$iid=$stmt->insert_id;
if ($iid == 0)
{
exit (json_encode(array(array('InsertPerson' => 'failed'))));
}
else
{
exit (json_encode(array(array('InsertPerson' => 'ok', 'pid' => $iid))));
}
break;
</code>
the field _sfm_form_submision_time_ contains the date, and I thought it was this that was causing the problem but when I remove it I still get the error InsertPerson Failed
I believe it's something to do with the 'bind_param("sss"' because I changed this to 'bind_param("sssss"' and it now works
From what I can determine I assume 's' equals string and 'i' would be integer are there other codes I should be aware of?
Thanks again for your quick responses