Quick recap | ||
|
Part I: MySQL tutorial Part II: PHP tutorial Start: Links: MySQL Manual PHP Manual Student Server Home |
This tutorial is intended to follow the MySQL tutorial. I recommend going through that tutorial, even if you are already familiar with MySQL, because it sets up the database used in this tutorial. Or, you can look at a quick refresher on the database we'll be using. Recall our conceptualized server: Last time, we learned about MySQL -- the bottom layer. Now, we'll move up and learn about PHP, the intermediate layer, so that we can make MySQL interface with a web server to put all of that good lovin' data on the web, where Normal Humans can access it. As you remember, the raw output from the database was pretty ugly, and so were the commands we used, and Mere Users would get confused. But PHP is your link between MySQL and HTML, so we can manipulate and beautify the data, and make it palatable to the unwashed masses. Just what is PHP, though? PHP is many things:
All you have to do to make PHP work is to tell the web server two things: one, that the file it's serving is a PHP file; and two, demarkate the areas that need to be interpreted as PHP instead of served verbatim as HTML. Confused? That's okay. It's easier than it sounds. When creating a PHP file, just name it foo.php instead of foo.html; that lets the server know, "Hey, there's some PHP code in here that needs to be interpreted before it gets served." So the server will go through the file, looking for parts that it needs to pass to the PHP interpreter. You mark those parts with a special tag: It's all easier to understand with an example.
|