Hi i have a table Users which have a field "score" to store the current score of the game. Now lets say the user have played a level and has obtain a highest score. So it should update it in the DB. How will i do this comparison? the highest score is store in the variable current score. i need to compare if currentscore>score(in the table) -> then update the field. Anyone can help? it should be in php code

Recommended Answers

All 3 Replies

How would you like us to help you? We can give directions on how to solve the problem but we won't give the code. Do you have any code to show us?

I have a field dbscore in my database and it it an array of 5(5 level). lets say i have a new score for level 3. I want to update that score in the database for that particular level. the code below is updating the values but i think it's not correct since the dbscore is an array. Can someone help?

$score is my new score.

mysql_query("UPDATE score SET dbscore='$score' WHERE name='$name'");
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.