Problem with Etna and highscores.

BlitzMax Forums/BlitzMax Programming/Problem with Etna and highscores.

Sokurah(Posted 2008) [#1]
I'm experimenting with Etna and I'm having a problem with it that I can't figure out, and I hope someone can help me.

I works...kinda. I've made a SQL table with 2 records - 'user' and 'scores', and if I set a new name it'll upload the score and the name as it should, but if I try again with the same name and a higher score nothing happens. It's like it won't store another score if the name of the player is already there.


Edit: I've put my question into a quotebox and removed my code as I've solved the problem. The problem was not the code but the tables on the sql server. I'd originally set the 'user' table as primary but when I changed the 'scores' table to be the primary instead, it worked. Yay. :)

I still have 2 questions though.

* I haven't been able to figure out how I can show the scores from a webpage. Can someone help?

* Each time you're syncing with the server a score gets added, but I'll probably never show more than the 10 highest scores, so is there something I can do to avoid hundreds (or more) entries into the database (and not having to log into the mysql manager and delete entries manually)?


Gillissie(Posted 2008) [#2]
It sounds like you need more knowledge of databases in general. I'm not sure what you mean by setting a table as the primary. Primary what?

I have a bad feeling that you created two databases named 'user' and 'scores', and are making a connection to one of them (hence the "primary" comment?).

Assuming I'm wrong about your db design, please tell me how you have your tables set up and I'll help you figure out your problems.


Sokurah(Posted 2008) [#3]
I do need more knowledge of databases in general - that's not a secret. :)

"I have a table with two differently named records and one of them apparently needs to be the primary one."
- I may have expressed myself wrongly, but if you know a little about databases you should be able to figure out what I mean by it.

Besides, like I also wrote - I have already solved the problem and there are two other questions up there instead.


ziggy(Posted 2008) [#4]
I haven't been able to figure out how I can show the scores from a webpage. Can someone help?

Use PHP to access your MySQL database, perform queries and output the result in html text

some links:

http://www.php-mysql-tutorial.com/

http://www.tizag.com/mysqlTutorial/


Sokurah(Posted 2008) [#5]
Thanks Ziggy,

Bleh, PHP seems a bit complicated but if I can program game I should be able figure this out. :-)

I'll look into it. Thanks again.