First of all, I just joined the ranch
Pardon me if my question has been answered before, because I have searched through the forum and there was none that could answer my problem
(or none that I understand)
I'm creating a game where at the end, I'll send an int score and String name to a php which will store it in web database.
I'm using a paid server for this.
I have a Javaapplet that is embedded in a mypage.com/play.php
I have a php for retrieving the url from the applet (or so it seems..) in mypage.com/test.php
Basically I followed this tutorial from http://woogley.net/misc/Highscore/ Now the Java console tells me java.lang.ArrayIndexOutOfBoundsException: 0
which comes from the line from Save.java
My DBComm looks like this
While this is my Save.java
I know no one likes to debug someone else's code, but I'm still open to any other suggestions and I want to learn,
honestly, this is my first time doing networking with applet, so I'm not sure where to start and why to use what packages.
I'm thinking of other ways, such as storing the scores in a .txt file in the same directory (eg: mypage.com/score.txt)
and use php to use them later.
But I'm not sure how
Swastik Dey wrote:Which code is leading the exception DBComm or Save?
I already marked it in my Save.
Swastik Dey wrote:as, are you sure that length of as is >0? Another point, the way you are comparing string
as=="0" // this is a reference comparison not a value comparison, you need to use the equals method
It originally is as.equals("0")
it didnt work, spits out the same java.lang.ArrayIndexOutOfBoundsException so i tried to change it to as=="0"
also, the same error.