
August 12th, 2002
09:50 AM
Tutorial/Guide: Errors and basic debugging
http://home.iprimus.com.au/jeb99/debugging.html
First tut I've written on PHP. It doesn't go into the indepth stuff, but it does explain how to avoid infinite ****ing loops, parse errors, index errors, the or die() syntax, trigger_error(), error types, etc.
Might be a bit tricky to understand....*shrug* No it doesn't go into output buffering, you want to learn that: [[ link ]]
___________________
Adam Goossens -- PHP is my mother tounge.
Linux: ( kernel.org | winehq ) -- f33l the p0w3r.
Nobody replying to your questions? Getting flamed? Getting told to RTFM? Ask your questions the right way.
Last edited by Jeb, September 28th, 2002 11:16 AM (Edited 1 times)

August 12th, 2002
11:14 AM

Too long :confused:
Goodjob however 
Did you talk about the if else statements structure??
<?php
if($this){
// is very annoying
}
else
{
// to read
}
?>
Also, if you get an error, look on the line ABOVE to see if you're missing any semi colons. If you are getting parse errors on the LAST line when you KNOW there are no errors on that line, it's a loop error, you are probably missing some brackets.
One thing I do is read my code in english.
<?php
'/[^(\[.+)\])][\s]((http:\/\/)|(www\.))([[:alnum:]]+)([\S]+)[^(\[.+\].+)]/si',
?>
who'd understand that?? So i just read to myself. "Find something that starts with any character, or a space, has either http:// or www in the beginning then some alphanumeric characters plus any non-return line characters to avoid an "Enter", plus something. Do all this without worrying about the case of the text (/si)"
By reading things, you'll find your error better.
Like this one in the other thread
<?php
$open_directory = @opendir($af_gallery);
while($r=readdir($open_directory)) {
if($r != "." && $r != "..") {
$col = "2";
print "<tr>";
for($x=0; $x < $col; $x++) {
print "<td><img src=\"".$af_images_url."/folder.gif\"><a href=\"".$af_url."animeFolio.php?dir=".$unique."\">".$unique."</a></td>";
}
print "</tr>";
}
}
?>
You get a printout TWICE, your suspect is a loop. I spy with my little eyes, TWO loops, bam, answer right there.
::bandit::
___________________
http://celerondude.com

August 12th, 2002
11:22 AM
man, my hands feel STICKY!!
___________________
http://celerondude.com

August 12th, 2002
01:16 PM
God job Jeb, now we won't get posts like "Help me, I've got a parse error on line ?? and I can't figure it out!!!"

___________________

:: KellenHolt.com
:: KellenHolt.com Forums - No Frills Discussion
:: Need Small Hosting Plan? CLICK

August 13th, 2002
06:54 AM
Originally posted by CDude
Too long :confused:
I know, I thought it was a bit long myself. But, oh well. Maybe I'll condense it when dreamweaver stops being a biznitch.
___________________
Adam Goossens -- PHP is my mother tounge.
Linux: ( kernel.org | winehq ) -- f33l the p0w3r.
Nobody replying to your questions? Getting flamed? Getting told to RTFM? Ask your questions the right way.

August 13th, 2002
09:13 AM
Very good 
___________________
Torrent
Ski-Info-Online.com
The complete ski and snowboarding information site

September 21st, 2002
07:04 PM
Neversidian
Status: Offline!
Originally posted by CDude
man, my hands feel STICKY!!
Why's that? 
___________________
Mugging Scotty Good.
www.muggingscotty.com

October 8th, 2002
06:46 AM
i don't know where i should post this question but here it goes I am following the tutorial on Robuks PHP login/registering tutorial and I do what the instructions says but i get this error message on the register.php
You have an error in your SQL syntax near 'VALUES ('', 'wes', md5('theman')' at line 1
I am fairly new to PHP and MySQL so i might not have entered the correct expressions in the script.

October 8th, 2002
06:50 AM
did u create the table correctlly?
___________________
I code alot.