Click here to Skip to main content
15,922,584 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to get points of respectived logged in user to be displayed from database corresponding to its push key i tried many ways but i just couldn't make it possible here is my code
JavaScript
const autoid=firebase.database().ref("user").push().key;


    firebase.database().ref("/").child(autoid).set({
    email :email,
    password : password, 
    points :"500", 
    Id:autoid 
   })


Here is the image of my database

What I have tried:

JavaScript
var query = firebase.database().ref().child("/");
query.once("value") .then(function(snapshot) {
      var email = snapshot.val().Email;
      var point = snapshot.val().Points;
 document.getElementById("points").innerHTML=point;
});
Posted
Updated 12-Mar-22 22:22pm
Comments
Richard Deeming 14-Mar-22 4:56am    
You appear to be storing passwords in plain text. Don't do that!

Secure Password Authentication Explained Simply[^]
Salted Password Hashing - Doing it Right[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900