Browser MMO Video #5
Re: Video#5
Thanks thats will be a great help. It seems like my HTML skill are proving pretty useless here. Maby after so reading I'll be able to hunt down what I'm doing wrong, because as things are going now I can't figure it out.
Re: Video#5
What helped me after watching the tuts then watching again then trying some of it was just repetition. If I had to I would copy in a working code and compare mine to it and then change this and that over and over. Kind of a pointless exercise but it did in the end speed up my learning I think.
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#5
your submit is capitalized in one place but not the other, as in it is posting Submit and looking for submit.
Do not get discouraged. It is these errors that make you a good programmer. A programmer that does not spend 4 hours on a silly mistake is not a programmer
Trust me, love these issues for they teach you more than anything else. I should know, I have spent hours fixing stupid errors and I did not have forums like these to ask my questions
Keep trying and feel free to keep asking questions.
Do not get discouraged. It is these errors that make you a good programmer. A programmer that does not spend 4 hours on a silly mistake is not a programmer
Trust me, love these issues for they teach you more than anything else. I should know, I have spent hours fixing stupid errors and I did not have forums like these to ask my questions
- PaxBritannia
- Posts: 680
- Joined: Sun Apr 18, 2010 1:54 pm
Re: Video#5
Eventually you get a bit skilled in debugging. Think of every time you get a bug as becomming a better debugger.
For the most common errors:
missing T_string:[/b: missing ";",
look at the line before the error occurs on
unexpected $end: unpaired <?php ?> or missing { }
use find function and check how many each of them are. <?php and ?> should have the same and { } should have the same. If they are not the same, that is what is causing the error. Use the find function on it and then skim the code for a missing pair.
undefined $(insert var here): you referred to a var that you didn't define.
If it is a superglobal ($_POST, $_GET, etc.), you can disregard it. Or use a if(isset($var)) statement. If it isn't, check that you have defined it before, maybe it was not because it was in an if-statement, check for spelling mistakes.
Pax.
For the most common errors:
missing T_string:[/b: missing ";",
look at the line before the error occurs on
unexpected $end: unpaired <?php ?> or missing { }
use find function and check how many each of them are. <?php and ?> should have the same and { } should have the same. If they are not the same, that is what is causing the error. Use the find function on it and then skim the code for a missing pair.
undefined $(insert var here): you referred to a var that you didn't define.
If it is a superglobal ($_POST, $_GET, etc.), you can disregard it. Or use a if(isset($var)) statement. If it isn't, check that you have defined it before, maybe it was not because it was in an if-statement, check for spelling mistakes.
Pax.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#5
Also, for debugging you can echo out your variables on your page to make sure they are what you think they should be. About 90% of my debugging work involves echoing out and investigating variables and why they are what they are.
The indelible lord of tl;dr
Re: Video#5
Ah yeah I forgot to mention echoing. I do a dumb amount of that trying to figure out where I went wrong
Re: Video#5
Oh i found another issue i made, i put:
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_query_array($playerinfo2);
instead of
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
but now i have to debug my battle code. :/ I need a better computer so i can see the videos better.
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_query_array($playerinfo2);
instead of
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
but now i have to debug my battle code. :/ I need a better computer so i can see the videos better.
Re: Video#5
Ok I've done some more codeing and I've made some progress and i'm going to try to figure some stuff out on my own now, but i hit another parse error, so could someone tell me some other sources of parse errors other then brackets.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#5
Those really are not so cut and dry. Anything that the PHP engine doesn't understand that doesn't fit under a more specific error will be a parse error.Dizuki wrote:Ok I've done some more codeing and I've made some progress and i'm going to try to figure some stuff out on my own now, but i hit another parse error, so could someone tell me some other sources of parse errors other then brackets.
The indelible lord of tl;dr
Re: Video#5
never mind just forgot a ; now onto video 7