PHP Require Database Primer Tutorial

PHP Require Database Primer Tutorial

PHP Require Database Primer Tutorial

Am wondering whether you were here when we introduced the concept of a PHP source file, on its own, acting like a web server residing database, by its mechanism of being able to update itself, yet, on an Apache/PHP/MySql web server arrangement, not easily be revealing that data to the general public, but to the user (equals computer/web browser type combination) it will allow access, as exemplified by the tutorials within the tutorial blog posting thread involving Signature Signature PHP Tutorial?

Well, today we extend that thought just a little bit, by trying to create a “child” PHP source file scenario, that is called from a supervisor via …


require('php_database.php');

… and then work off either …

  • $_GET[] arguments and/or …
  • $_POST[] arguments

… to store and recall “database” data stored within the bowels of the “child” PHP that has the capability of storing and updating this “database” data.

In the industry you tend to hear about “database drivers” or “database engine”. Well, today, we have those being just plain straight PHP code. This interests me, but then, you know, those butterflies in Brazil changing the weather look interesting too … we hope you share this Latin Thang Going On … huh?!

First thing with this project we researched was whether PHP’s require can take arguments. We came out thinking, not except in some really kludgy fashion … and we’re not into fashion … so if we were cornered … alley fashion … moi … no.

Before we go any further, you may have asked “why do this?”. It strikes us that is quite a legitimate question, to which we’d answer, that we like ideas that …

  • have a supervisory/child relationship … and in so doing, for us …
  • have us modularize PHP code in a way to make “the parts of the whole” logically smaller (and/or logically belonging in “compartments of code”) … “logically” being the operative word … “why do it?” would be our ask of “illogical” (or arbitrary) approaches here

So try today’s supervisor web application (you could call using_php_database.php) (and you could try setting your own database stored recall value via this (to new window)) supervising our “child” (called via PHP require) php_database.php for our “PHP Source Code Database” concept today.

As per usual, we give thanks to those geniuses on the WWW … today it’s … this useful link … so … thanks.

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

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

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>