createUpdate(); // create a new document for the data // please note that any type of validation is missing in this example to keep it simple! $doc = $update->createDocument(); $doc->id = $_POST['id']; $doc->name = $_POST['name']; $doc->price = $_POST['price']; // add the document and a commit command to the update query $update->addDocument($doc); $update->addCommit(); // this executes the query and returns the result $result = $client->update($update); echo 'Update query executed
'; echo 'Query status: ' . $result->getStatus(). '
'; echo 'Query time: ' . $result->getQueryTime(); } else { // if no data is posted show a form ?>
Id:
Name:
Price: