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]');
  }
(this example uses ADODB syntax)
With large amounts of data this would last very long. Instead, try an INNER JOIN. This would speed up the process to maybe 1/100 of the time:
SELECT data FROM table INNER JOIN othertable ON table.identifier=othertable.identifier



Radiovibrations.com -> php