PHP and SQL
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.
Debugging
If you use ADODB you can debug the SQL queries scripts by setting the line
$sql->debug = true;
Less queries
Try to limit the number of SELECT queries and let postgres do the work. Avoid this:
$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