PostgreSQL PHP Tutorial

PostgreSQL PHP Tutorial

PostgreSQL PHP Tutorial

Some time ago we talked about the PostgreSQL database, and showed you some command line (installation and) usage via a MacBook Pro Terminal application’s (bash environment) command line.

So that showed a bit of SQL for PostgreSQL and you can see it is a lot like other database SQL, and am not about to tell you otherwise today.

The only SQL part that may not be transportable to other database SQL today, is the use of the PostgreSQL “to_date()” function, but the lesson is that so much relational database coalesces with the SQL (DML) for …

  • SELECT (query the database) … for reading …
  • INSERT (add record to the database) … for writing …
  • UPDATE (amend a record of the database) … for writing …
  • DELETE (delete record of the database) … for writing (oddly)

… they all have six letters, and know that has made things cute programmatically for me in the past.

So it is good to not let database work phase you for the way you live with it from day to day with the commands above … but what is sometimes more confusing is the way you connect with databases … generally it involves …

  • hostname (and port, perhaps)
  • username
  • password
  • database (mostly)
  • access rules (occasionally)

We’ve talked about PHP and MySql a fair bit at this blog, and the fact is PHP can quite effectively work with PostgreSQL as well, which we show you today with our local (Mac) MAMP local web server, but do not have available at the domain rjmprogramming.com.au, which PHP was not compiled to include module “pgsql” … the PHP command “phpinfo()” will tell you what the state of play is with your Apache/PHP web server with regard to this.

So today, on MAMP, we take up where we left off with PostgreSQL Primer Tutorial as shown below, and write some PHP you could call pg.php to perform SQL (DML) on that “films” table of that tutorial below.

You can INSERT and UPDATE and DELETE to the database, and behind the scenes we SELECT all the database records of the “films” table to keep you up to date with how things sit.

We used the great Gifpal to create an animated GIF (of a MAMP session execution) for your perusal here.

Link to PostgreSQL Database Server more information … via Wikipedia.
Link to PostgreSQL Database Server home … Open Source.
Link to PostgreSQL Database Server … documentation.

Hope you get something out of today’s database (and PHP) offering.


Previous relevant PostgreSQL Primer Tutorial is shown below.

PostgreSQL Primer Tutorial

PostgreSQL Primer Tutorial

Welcome to the PostgreSQL (Database Server) Primer Tutorial.

The PostgreSQL Database Server product is an excellent Open Source database that has been established for many years. PostgreSQL is an object-relational database management system, and read along with Wikipedia, how its emphases are extensibility and standards-compliance.

Doing this tutorial, and please forgive my naivety with PostgreSQL, I was amazed at the DDL similarities with those databases I was more familiar with, namely MySql, MS-SQL, Oracle, Advantage and Access, and can imagine setting up workable systems in a short space of time.

In the primer tutorial you can see early parts of an install to a MacBook Pro and its “psql” command line interface, like the wonderful “sqlplus” interface of Oracle.

Link to PostgreSQL Database Server more information … via Wikipedia.
Link to PostgreSQL Database Server home … Open Source.
Link to PostgreSQL Database Server … documentation.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in Animation, Database, eLearning, Tutorials and tagged , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

21 Responses to PostgreSQL PHP Tutorial

  1. Hello There. I found your blog the usage of msn. That is a very neatly written article.
    I will be sure to bookmark it and come back to learn more of your helpful info.
    Thank you for the post. I will definitely comeback.

  2. Cesar says:

    Hace unas semanas atrás se tenía la oportunidad de percibir la última actualización de la aplicación para el popular servicio de correo de
    Google, o sea Gmail.

  3. I think the admin of this web hosting providers review page is actually working
    hard in support of his site, as here every data is quality based stuff.

  4. nhl farming says:

    What i do not realize is in truth how you’re not actually much
    more well-favored than you might be now. You’re very intelligent.
    You know thus significantly relating to this matter, produced
    me in my view imagine it from so many varied angles. Its like men and women don’t seem to be interested unless it’s one
    thing to accomplish with Lady gaga! Your own stuffs outstanding.
    At all times deal with it up!

  5. Shelby says:

    I’d like to find out more? I’d like to find out more details.

  6. Magnificent goods from you, man. I’ve understand your stuff previous to and you’re just too wonderful. I really like what you have acquired here, really like what you’re saying and the way in which you say it. You make it entertaining and you still care for to keep it smart. I can not wait to read much more from you. This is actually a wonderful site.

  7. My partner and I absolutely love your blog and find many of your post’s to be precisely what I’m looking for. can you offer guest writers to write content to suit your needs? I wouldn’t mind creating a post or elaborating on a few of the subjects you write concerning here. Again, awesome web site!|

  8. I love the suggestions on this web site, they’re always to the point and just the info I was seeking for

  9. There is noticeably a great deal of funds to comprehend about this. I suppose you produced particular nice points in functions also.

  10. admire says:

    Thanks, I’ve just been searching for info about this subject for a while and yours is the greatest I have found out till now. But, what concerning the bottom line? Are you certain concerning the supply?

  11. Hello. Great job. I did not expect this. This really is a outstanding articles. Thanks!

  12. ecstatic says:

    Hiya very cool website!! Guy .. Excellent .. Superb .. I’ll bookmark your web site and take the feeds also…I’m glad to search out numerous useful information here within the post, we need develop extra strategies on this regard, thanks for sharing.

  13. Diani Beach says:

    I went over this world-wide-web web-site and I think you have got loads of fantastic details, saved to bookmarks (:.

  14. Victor says:

    Respect the blog you furnished.. I enjoy you discussing your point of view.. Particularly valuable viewpoint, many thanks for blogging.. My personal web browsings seem full.. thank you.

  15. Heavenly says:

    Great write-up, I¡¦m regular visitor of one¡¦s web site, maintain up the nice operate, and It is going to be a regular visitor for a lengthy time.

  16. reduce says:

    Extremely practical point of view, appreciate your posting.. Extremely useful point of view, thank you for giving.. My personal browsing efforts seem total.. thank you. Loving the publish.. thankyou

  17. my link says:

    Simply wanna admit that this is extremely helpful, Thanks for taking your time to write this.

  18. Someone necessarily help to make severely articles I’d state. That is the first time I frequented your website page and so far? I amazed with the analysis you made to make this actual post extraordinary. Fantastic activity!|

  19. add says:

    Well I really liked studying it. This information provided by you is very effective for proper planning.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>