|
Presented by: Kimmie Dicaire
This tutorial will assume that you have both PHP and Postgresql installed and functioning. Both PHP3 and Postgresql have very detailed instructions in the source code directory. Read the REAME and INSTALL files for each, and follow them EXACTLY as written for a smooth install. IF you try to jump ahead or skip steps then you will not have a proper install and will have to start over from scratch. We will start with a few basics and build a Postgresql database for these examples. Then we will show you how to implement PHP3 code into your web files to access the newly created database. This site is for beginners of PHP3 usage, therefore you will not see very much as far as complicated code. The advanced PHP3 users section is still in process of being designed, please check back frequently for its arrival. For best results please follow the entire tutorial step by step so you get the best possible understanding of the process from database creation to PHP3 usage. If you prefer to jump ahead to the PHP code click here
Lets begin the creation of our new database. For your convience all issued commands will be in bold. Make sure postmaster is running with the -i switch. You may do ps ax |grep post on the commandline as root to see if it is running. If its running proceed to the next step. If it is not running then login as the postgres user and start it up, NEVER start postmaster as any other user than postgres. You can start it up with a command like this /usr/local/pgsql/bin/postmaster -i & If you do not know the full path to the executable you can run this command as root to find it which postmaster Now as the postgres user type CREATEDB phonelist then hit enter.
This will create the database called phonelist.
CREATE SEQUENCE config_seq START 1 INCREMENT 1;
CREATE TABLE "address" (
NOTE: To find out more on how to use PostgreSQL check out the Postgresql manuals for best comprehension. Start with the select statements in the manual to play with your newly created database. Ok now your database is functional and ready to be used with PHP3 to access it via your web server. When we leave this page and begin our journey into PHP3 all the code
will be color coded for your convience and to catch your eye. I will be
doing this by using the extention .phps for these examples instead of the
standard extention .php3. In order for the sample code to actually work
you will need to use the standard extention .php3 when you name your
pages. Without further ado lets move onto the PHP3 intergration part of
this tutorial, just click here to be on your way.
Warning: Failed opening 'right.php3' for inclusion (include_path='.:/usr/share/pear') in /home/matrix/html/examples/php-post.php on line 151 |