Skip to Content
Learning MySQL
book

Learning MySQL

by Saied M.M. Tahaghoghi, Hugh E. Williams
November 2006
Beginner
620 pages
19h 47m
English
O'Reilly Media, Inc.
Content preview from Learning MySQL

Introducing PHP

PHP is a scripting language that is designed to be embedded into the HTML markup used for web pages; it can be used for other purposes, but that’s outside the scope of our discussions. It works on almost all Unix platforms—including Linux and Mac OS X—and with Windows 32-bit environments, such as Windows 2000, XP, and Vista. Web pages that contain PHP scripts are preprocessed by the PHP scripting engine, and the source code is replaced with the output of the script. Indeed, the acronym PHP obliquely suggests just that—PHP: Hypertext Preprocessor.

PHP is extremely popular for several reasons: it’s easy to include PHP scripts in HTML documents, PHP is free in a monetary and open source sense, it has a large number of powerful but easy-to-use function libraries, and it shares syntax with C or Perl-like languages. PHP is also widely supported; there are a very large number of books, web sites, and add-on products available. You’ll find that moving from simple examples to advanced material is made easy by this wide-ranging support.

Example 13-1 shows simple PHP script embedded in an HTML document:

Example 13-1. PHP Script to say Hello, world!

<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd" >
<html>
  <head>
    <title>Hello, world</title>
  </head>
  <body>
    <?php echo "Hello, world"; ?>
  </body>
</html>

When preprocessed by the PHP scripting engine, the short (and not very useful) script:

<?php echo "Hello, world"; ?>

is replaced ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Learning MySQL, 2nd Edition

Learning MySQL, 2nd Edition

Vinicius M. Grippa, Sergey Kuzmichev
MySQL Cookbook, 4th Edition

MySQL Cookbook, 4th Edition

Sveta Smirnova, Alkin Tezuysal

Publisher Resources

ISBN: 0596008643Errata Page