Notes on PHP and Postgres/SQL

An unsorted collection

HTML radio input onchange

<input type="radio" name="somename" onchange="alert('change')"> The event will only fire if a button is selected. Nothing will happen if the button is unselected by clicking on another button of that name-group. (FF51)

&& vs AND

If you have multiple expressions in PHP, AND will stop checking after the first FALSE, && will not.

Postgres string concat

The glue operator is ||. If you put raw strings and columns together the concat function shows errors. Instead use: update table set anycol=anycol||' heyho '::text||othercol

Update Inner Join

Don't try that. if you want to update connecting 2 tables use this syntax: update table set x=y from table2 where...


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. If you use ADODB you can debug the SQL queries scripts by setting the line
$sql->debug = true; -> php