In order to see if your script works, You need three things:
- A database, in your case PostgreSQL
- PHP
- A server, use Apache.
If you dont have any idea of what you;re doing, i suggest you download the WAPP-server.
It's one package that installs everything for you. Postgres, PHP and Apache.
To learn the basics of PHP, just download or buy PHP for Dummies.
In the end, its all logics and if you basically know whats happening in a PHP script, you can always try to make sense of it. Google helps a lot too.
The code to connect to a database in postgres from PHP is pg_connect(''). So if you google that, you'll find a tutorial about it.
It's a hobby with a load of trial an' error. But the sensation when you get things to work is ridiculously satisfying.
I wish you the best of luck.
Oh and PS.
Notepad sucks.
I use Dreamweaver from Adobe to make my PHP, but offcourse you have to buy the program.
I suggest you download ConTEXT. It's free and it works fine.