你可以試試這樣說:
$myObj= new ParseObject("TestObject");
$myObj->set("objIdd", 1234);
$myObj->set("objName", "My Name");
try {
$myObj->save();
echo 'New object created with objectId: ' . $myObj->getObjectId();
} catch (ParseException $ex) {
// Execute any logic that should take place if the save fails.
// error is a ParseException object with an error code and message.
echo 'Failed to create new object, with error message: ' + $ex->getMessage();
}
//objectId: "XYZABC", objIdd: 1234, objName: "My Name"
$query = new ParseQuery("TestObject");
try {
$myObj = $query->get("XYZABC");
// The object was retrieved successfully.
} catch (ParseException $ex) {
// The object was not retrieved successfully.
// error is a ParseException with an error code and message.
}
看看這個guide。
不幸的是,沒有奏效。 我看着ParseQuery.php文件,發現查詢實際上工作正常,因爲我可以在_request方法後輸出一個json數組對象,但當 $ obj - > _ mergeAfterFetchWithSelectedKeys($ row,$ this - > selectedKeys);調用了 。 – djb808
你見過這個Github條目https://github.com/ParsePlatform/parse-php-sdk/blob/master/src/Parse/ParseObject.php – crisu
是的我已經看過它,但無法找到事情發生的地方出錯了。相反,我決定繼續使用REST API獲取json數據並從那裏開始。 – djb808