akoper > PHP & mySQL

The Internet is very powerful.  The essence of this power is database-backed "Web sites" (applications) that allow people from anywhere at anytime to put information online, and allow people from anywhere at anytime to get that information.  The following is the essence of a  database-backed Web application made with PHP and mySQL.

There are a variety of different technologies you can use to make Web apps - Java, Microsoft, etc. - but PHP and mySQL are common, free, open source technologies.  Facebook is made in PHP. 

The first step is to learn how to make Web pages.  Once you know HTML, CSS, hyperlinks, etc., if you are willing to do some technical work, you can "take it to the next level."

Servers are surprisingly like PCs, except that they have different types of programs running on them.  Most Web hosting companies have servers that run the Linux operating system because Linux is open source and free, and, therefore, they have PHP and mySQL running on top of that.  The PHP interpreter executes the PHP files and the mySQL database stores the data.

To make a Web application, you make PHP files instead of HTML files and link them together with hyperlinks

Databases are the best, most efficient way to store information, and the database will handle most of the work for you.  With all databases, people want to do four basic things, which are abbreviated as "CRUD."  They want to "C"reate or add records, "R"ead or view records, "U"pdate records, or "D"elete records.  When you make a database-backed Web application, you are, in essence, writing a little bit of code (a "wrapper" in Web lingo) to tie the database to the Internet so that the user can see things and operate it via their browser.

The following 14, small files are a basic, fully-functional Web application:  index.phpcreate.phpcreate_db.phpview.phpupdate.phpupdate_db.phpupdate1.phpdelete.php and delete_db.php.  The following three files create the page template so that all of the pages look the same: html_header.inchtml_footer.inc and css.css  The following two files are for the database: utils.inc and database.sql .

Download these files here: phpMySQL.zip

FTP/upload them to a directory on a Web server.  They will physically be in alphabetical order list.  The following diagram shows the "architecture" of the Web application, how they relate logically:

To execute a PHP script, from your browser, go to http://[your domain name]/index.php.  The homepage PHP file will execute/run.  To execute the other scripts/functions, click on the hyperlinks to go to those "pages."

Your custom-written PHP program needs to "talk" to the mySQL database, however, which has not been set up.  You will need to create the database for your Web application.  Most Web hosting companies offer a utility called cpanel, which is at http://[your domain name]/cpanel, to create the database.  Most hosting companies offer another utility called phpMyAdmin, available through cpanel, to create the database table.  You can either type in the database table names and field types in phpMyAdmin or import the sql file to create the database table.  You will put the database name and secret user ID and password in the utils.inc file so that all of the PHP files/scripts that need to access the database can get that info from there.

I have skipped the basics of PHP and SQL - which you will probably have to get a handle on and which are the normal starting points for this - but these files are magic.

I would put a running version of this PHP and mySQL application on my server - this one is a simple, made-up, high school class reunion application - except I am not going to pay any attention to it, and I don't want a spam bot coming across it, autosubmitting the form over and over, and filling up the database with megabytes of spam.

You can take these scripts and change the colors, font, text, and database fields, and make your own database-backed Web application.

These files make what are the essence of eBay, Google, Facebook, Yahoo, youTube, amazon.com, mySpace, LinkedIn, monster.com, etc.  Make your own, hook it up to a PayPal or Google Checkout account, and become the next cyber-billionaire!