I'm receiving this error when trying to read a JObject in C# from PHP, it is the result of a basic query "SELECT * FROM items"...
Unexpected character encountered while parsing value: S. Path '', line 0, position 0.
PHP
$query = ($_POST["test"]);
if ($result = $mysqli->query($query)
{
$jsonResult = json_encode($result);
}
echo $jsonResult;
C#
public JObject GetThat()
{
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
Stream Answer = WebResp.GetResponseStream();
string phpResponse = Answer.ToString();
JObject myResult = JObject.Parse(phpResponse);
return myResult;
}
What am I doing wrong? Thanks.
phpResponseyourself by adding a breakpoint to see if it is really valid JSON$_POST["test"]become a query?