Update records in firebase using php by UUID
up vote
0
down vote
favorite
I am new to firebase and I want to update single record by UUID using PHP , I have checked and tried many solutions available on google but didn't find any solution which fullfill my requirement, screenshot attached of my collection where i want to update -LRphnkdvcEN5cIKkbDs
UUID's data. Below is my code
UPDATE CODE
public function update(array $data){
if(empty($data) || !isset($data)){
return FALSE;
}
else{
$reference = $this->database->getReference($this->dbname)->orderByChild('id')->equalTo($data['record_id'])->update($data);
return TRUE;
}
}
php firebase firebase-realtime-database php-7.2
add a comment |
up vote
0
down vote
favorite
I am new to firebase and I want to update single record by UUID using PHP , I have checked and tried many solutions available on google but didn't find any solution which fullfill my requirement, screenshot attached of my collection where i want to update -LRphnkdvcEN5cIKkbDs
UUID's data. Below is my code
UPDATE CODE
public function update(array $data){
if(empty($data) || !isset($data)){
return FALSE;
}
else{
$reference = $this->database->getReference($this->dbname)->orderByChild('id')->equalTo($data['record_id'])->update($data);
return TRUE;
}
}
php firebase firebase-realtime-database php-7.2
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am new to firebase and I want to update single record by UUID using PHP , I have checked and tried many solutions available on google but didn't find any solution which fullfill my requirement, screenshot attached of my collection where i want to update -LRphnkdvcEN5cIKkbDs
UUID's data. Below is my code
UPDATE CODE
public function update(array $data){
if(empty($data) || !isset($data)){
return FALSE;
}
else{
$reference = $this->database->getReference($this->dbname)->orderByChild('id')->equalTo($data['record_id'])->update($data);
return TRUE;
}
}
php firebase firebase-realtime-database php-7.2
I am new to firebase and I want to update single record by UUID using PHP , I have checked and tried many solutions available on google but didn't find any solution which fullfill my requirement, screenshot attached of my collection where i want to update -LRphnkdvcEN5cIKkbDs
UUID's data. Below is my code
UPDATE CODE
public function update(array $data){
if(empty($data) || !isset($data)){
return FALSE;
}
else{
$reference = $this->database->getReference($this->dbname)->orderByChild('id')->equalTo($data['record_id'])->update($data);
return TRUE;
}
}
php firebase firebase-realtime-database php-7.2
php firebase firebase-realtime-database php-7.2
edited Nov 21 at 14:33
Frank van Puffelen
220k25361387
220k25361387
asked Nov 21 at 12:27
Vivek Singh
2,2921721
2,2921721
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
If you know the key of the node you want to update, you don't need a query. You can just construct the path to the node, and call update
on that:
$reference = $this->database->getReference($this->dbname."/".$data['record_id'])->update($data);
Or
$reference = $this->database->getReference($this->dbname).getChild($data['record_id'])->update($data);
I want to know is there any way by which I can set datatype for fields in firebase, and is it possible to create multiple tables(collections) in firebase for creating a web portal as well as android and ios app ?
– Vivek Singh
Nov 22 at 7:42
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
If you know the key of the node you want to update, you don't need a query. You can just construct the path to the node, and call update
on that:
$reference = $this->database->getReference($this->dbname."/".$data['record_id'])->update($data);
Or
$reference = $this->database->getReference($this->dbname).getChild($data['record_id'])->update($data);
I want to know is there any way by which I can set datatype for fields in firebase, and is it possible to create multiple tables(collections) in firebase for creating a web portal as well as android and ios app ?
– Vivek Singh
Nov 22 at 7:42
add a comment |
up vote
0
down vote
accepted
If you know the key of the node you want to update, you don't need a query. You can just construct the path to the node, and call update
on that:
$reference = $this->database->getReference($this->dbname."/".$data['record_id'])->update($data);
Or
$reference = $this->database->getReference($this->dbname).getChild($data['record_id'])->update($data);
I want to know is there any way by which I can set datatype for fields in firebase, and is it possible to create multiple tables(collections) in firebase for creating a web portal as well as android and ios app ?
– Vivek Singh
Nov 22 at 7:42
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
If you know the key of the node you want to update, you don't need a query. You can just construct the path to the node, and call update
on that:
$reference = $this->database->getReference($this->dbname."/".$data['record_id'])->update($data);
Or
$reference = $this->database->getReference($this->dbname).getChild($data['record_id'])->update($data);
If you know the key of the node you want to update, you don't need a query. You can just construct the path to the node, and call update
on that:
$reference = $this->database->getReference($this->dbname."/".$data['record_id'])->update($data);
Or
$reference = $this->database->getReference($this->dbname).getChild($data['record_id'])->update($data);
answered Nov 21 at 14:37
Frank van Puffelen
220k25361387
220k25361387
I want to know is there any way by which I can set datatype for fields in firebase, and is it possible to create multiple tables(collections) in firebase for creating a web portal as well as android and ios app ?
– Vivek Singh
Nov 22 at 7:42
add a comment |
I want to know is there any way by which I can set datatype for fields in firebase, and is it possible to create multiple tables(collections) in firebase for creating a web portal as well as android and ios app ?
– Vivek Singh
Nov 22 at 7:42
I want to know is there any way by which I can set datatype for fields in firebase, and is it possible to create multiple tables(collections) in firebase for creating a web portal as well as android and ios app ?
– Vivek Singh
Nov 22 at 7:42
I want to know is there any way by which I can set datatype for fields in firebase, and is it possible to create multiple tables(collections) in firebase for creating a web portal as well as android and ios app ?
– Vivek Singh
Nov 22 at 7:42
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412029%2fupdate-records-in-firebase-using-php-by-uuid%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown