Read the thin guide , chapters 2 through 9 are the most important to get you started.
Make sure that you are doing the correct error handling in PHP and carefully reading all the error messages: in most cases, it tells you exactly what went wrong and how to fix it. Appendix A contains all the error messages and codes you need. PostgreSQL does not accept invalid input or queries, it fixes or you get an error to start debugging. And this is good, fewer errors and less time you spend on scripts.
pg_query_params () and pg_fetch_all () are some great functions in PHP for interacting with PostgreSQL, check the PHP manual .
Frank heikens
source share