PHP and SQL
Debugging
You can debug your scripts by setting the line
$sql->debug = true;
ADODB
makes data access much easier while it doesn't slow down the script noticeably. It's a common syntax for different database types like postgres, mySQL and others.
Something similar will be implemented with PHP5. But while using PHP4 ADODB appears very helpful. Just type Adodb into Google and you'll find many resources.
Double Loops
Try to avoid double loops like:
$q = $db->Execute('SELECT data,identifier FROM table');
while ($x=$q->FetchRow())
{
$q2= $db->Execute('SELECT * FROM othertable WHERE identifier=$x[identifier]');
}