Connecting to a Database with PHP

For those of you who have been following along with the PHP/MySQL tutorials on my site, this article will provide the next step in learning to create database driven Web sites. We will build upon the knowledge acquired by creating the "rescued pets" database in phpMyAdmin. Now we will actually build HTML pages with embedded PHP scripts that will allow us to connect to the MySQL server and our database, as well as insert, update, and delete data. We're getting very close to our ultimate goal of creating a Content Management System, a true interactive database driven Web application.

This tutorial does assume you know a little HTML because you will have to work with raw code. Because we will be doing a lot of hard programming, I have provided the source code in case you get stuck. It is very easy to forget a closing quote, semicolon, or other small detail, and believe me, the devil is in the details when one gets into programming. I highly recommend BBEdit Pro 7.01 for creating PHP pages, but BBEdit lite, or even TextEdit will work just fine.

Let's get started connecting to our database!-->

Back to Unix Tips Page-->