Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

How can I update a specific object #34

Closed
liorwn opened this issue Aug 27, 2012 · 2 comments
Closed

How can I update a specific object #34

liorwn opened this issue Aug 27, 2012 · 2 comments

Comments

@liorwn
Copy link

liorwn commented Aug 27, 2012

Hi,

This might seem like a stupid question but I couldn't figure out how to update a specific object.

I know the following doesn't work because it calls to a class instead of a specific object within a class (and POST instead of PUT) but I have no idea what to change in order to make it work:

$o = $_POST["objectId"];
$odoValue = intval($_POST["Value"]);

$parseObject = new parseObject('Cars');

$parseObject->VALUE = $Value;
$response = $parseObject->save();

What I'm trying to figure out is how to update the Field 'VALUE' for a specific objectId within the Class Cars.

Thanks in advance! Any help would be appreciated.

@andrewscofield
Copy link
Owner

Somewhere along the way from v1 to v2, I've lost my ability to update an object! Ooops :)

I've updated the library to include this ability, see example below:

$objectId = $_POST['objectId'];
$newValue = $_POST['Value'];

$parseObject = new parseObject('Cars');
$parseObject->VALUE = $newValue;
$return = $parseObject->update($objectId); //should return updatedAt date if successfull

let me know how this works... I just made it and only did a quick test on it.

@liorwn
Copy link
Author

liorwn commented Aug 27, 2012

Perfect! Thanks so much. I was starting to think I'm getting delusional :)

On Mon, Aug 27, 2012 at 12:57 AM, apotropaic notifications@github.comwrote:

Somewhere along the way from v1 to v2, I've lost my ability to update an
object! Ooops :)

I've updated the library to include this ability, see example below:

$objectId = $_POST['objectId'];
$newValue = $_POST['Value'];

$parseObject = new parseObject('Cars');
$parseObject->VALUE = $newValue;
$return = $parseObject->update($objectId); //should return updatedAt date if successfull

let me know how this works... I just made it and only did a quick test on
it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/34#issuecomment-8047017.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants