Page 21 of 35
Re: Video#5
Posted: Wed Jun 23, 2010 10:58 pm
by Dizuki
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
Posted: Wed Jun 23, 2010 11:43 pm
by Rastan
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.
Re: Video#5
Posted: Thu Jun 24, 2010 12:04 am
by hallsofvallhalla
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.
Re: Video#5
Posted: Thu Jun 24, 2010 12:20 am
by PaxBritannia
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.
Re: Video#5
Posted: Thu Jun 24, 2010 12:45 am
by Jackolantern
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.
Re: Video#5
Posted: Thu Jun 24, 2010 1:12 am
by Rastan
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
Posted: Thu Jun 24, 2010 3:44 am
by Dizuki
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.
Re: Video#5
Posted: Thu Jun 24, 2010 5:18 am
by Dizuki
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.
Re: Video#5
Posted: Thu Jun 24, 2010 6:29 am
by Jackolantern
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.
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.
Re: Video#5
Posted: Thu Jun 24, 2010 6:29 am
by Dizuki
never mind just forgot a ; now onto video 7