- Edited
As mentioned in a post I recently read http://board.phpbuilder.com/d/10240313 (not all of it, it seams some people can't stop talking here so fast it's like IRC now) some people have NO IDEA whatsoever about debugging and actually finding errors so here are my useless hints :
1. When you code a MySQL query use new lines :
$sql = "SELECT
`yourtable`,`field1` as f1,
`yourtable`,`field2` as f2
FROM
`yourtable`
";
Why? If you have an error MySQL will give you line number referencing a line INSIDE the query. Always saves time to actually be able to use the info.
2. When you code a MySQL query echo it in a HTML comment (not in production) :
$sql = "SELECT
`yourtable`,`field1` as f1,
`yourtable`,`field2` as f2
FROM
`yourtable`
";
echo "<!--\n$sql\n-->";
Why? Well if your pages doesn't work try running your querries in phpMyAdmin or your DB manager and see the output. It sometimes is interesting.
More soon (tired now)