This site, along with its many international mirrors, should be your home away
from home. From the home page, you can search the manual or one of the many
mailing lists. Among the many helpful resources are the following:
â—† PHP Annotated Manual (http://www.php.net/manual/) â€” The online
manual is really terrific; it includes user comments, some of which clarify
the use of some of the trickier functions in PHP.
â—† Downloads (http://www.php.net/downloads.php) â€” Here you can find
not only the various distributions, but also an HTML manual that you can
download and put on your local machine.
â—† Daily snapshots (http://snaps.php.net) â€” PHP is an active open-source
project, and features and bug fixes are constantly added to the code base.
Before official releases are made, you can get the most up-to-date code
here: Source code is updated daily. Note that this service is best for the
true hacker with a box devoted to development; if you have room for only
one installation, get the most recent stable source code. A link to the most
recent stable source is always available from http://www.php.net/.
â—† Bug database (http://bugs.php.net) â€” Wondering if there is a problem
with a function? Head over to this site to search through the bug reports,
or to add one yourself â€” but be very sure that youâ€™ve found a bug before
submitting a report.
â—† FAQ (http://www.php.net/FAQ.php) â€” Before you post to any mailing
list or start writing an application, read the FAQ.
692 Part V: Appendixes
PHP mailing lists
One of the great things about the Web, and about open-source projects in particu-
lar, is the quality of the advice available on the mailing lists. Many lists, covering
many specific topics, are available. The ones discussed in this section are all part of
php.net and use the lists.php.net mail domain. You can subscribe to any of
these lists on http://www.php.net/mailing-lists.php, and they are all archived
at http://marc.theaimsgroup.com/. The core developers monitor the list and
respond to questions and complaints.
If you want to keep up with the goings-on of any of the lists but would
rather not stuff up your inbox, you can also get to these mailing lists via a
newsgroup reader. Just connect to news.php.net.
â—† PHP general â€” This is the generic support area. Over the course of a typi-
cal day over 100 emails are posted to this list. It is amazingly helpful,
even if you donâ€™t have an interest in posting questions or supplying
answers. Your comrades have some interesting techniques and knowledge,
which they share daily.
Please practice good etiquette when posting to the mailing lists. First check
one of the searchable archives to make sure your question is something
resembling unique. And please, read the FAQ.
â—† Database list â€” This one is a natural for most everyone reading this book
because it has to do with how PHP interacts with databases. This is key to
almost all Web applications.
â—† Installation list â€” If you are having problems getting PHP installed on
your box, this is the place to go.
At the core of the PHP is the Zend engine, which was built by Zeev Suraski and
Andi Gutmans. Their work became the foundation for a company that is offering
products that make PHP even more powerful. Zend products include a cache, which
can really increase speed, an optimizer, which can help make badly written code
Appendix I: PHP and MySQL Resources 693
run faster, a compiler, which makes PHP unreadable (which is great if youâ€™re plan-
ning on distributing code that you would rather not be open source), and an inte-
grated development environment (IDE). And who wouldnâ€™t want that?
The zend.com site includes some valuable resources:
â—† Code Gallery (http://zend.com/codex.php) â€” This is one of the better
code galleries out there. Browse it and see if it contains functions that will
make your life easier.
â—† Applications (http://zend.com/apps.php) â€” What? What you have here
â—† Tutorials (http://zend.com/zend/tut/) â€” Zend provides a growing
number of very informative tutorials that cover a variety of topics.
â—† Weekly Summary (http://zend.com/zend/week/) â€” Avi Lewin writes a
weekly article that summarizes the major issues the core developers dis-
cussed over the past week. Itâ€™s interesting stuff, and can give you a heads-
up about what will be happening in PHPâ€™s future.
PHPBuilder was once the best source for PHP articles. Tim Perdue, who used to run
PHPBuilder, built a great base of articles that cover topics including databases,
Cascading Style Sheets, and other topics of interest to developers who work in the
Web environment. PHPBuilder also has discussion boards, job boards, and a code
library. It is really worth checking with frequently, although the quality has
dropped off over the past year or so.
phpMyAdmin on Sourceforge
Earlier in the book we recommended the phpMyAdmin, a PHP tool for Web-based
administration of MySQL. Tobias Ratschiller and Till Gerken provide several other
useful tools. Itâ€™s all on SourceForge at http://sourceforge.net/projects/
PEAR stands for the PHP Extension and Application Repository, and weâ€™ve men-
tioned it many times already in this book. It is a set of code being written by some
very skilled programmers whose goal is a common set of well-written extensions the
rest of us can incorporate into our own PHP applications. The extensions include a
templating engine, a database-abstraction layer, and much much more. Stig Bakken,
one of the core developers, is heading up the project.
694 Part V: Appendixes
You can most easily obtain a current copy of PEAR through the PHP CVS repos-
A Portuguese programmer named Manuel Lemos is among the most prolific PHP
coders on the planet, and he shares his code at http://www.phpclasses.org. In
fact, PHPclasses is now a code repository for anyone who has classes to share with
the PHP world. The following are of particular note:
â—† Manuelâ€™s Form Processing Class â€” This class provides a uniform method
for creating and validating forms. It accounts for about every type of
â—† Metabase â€” This is a very complete database-abstraction layer.
â—† Mail Class â€” This class makes sending e-mail with attachments quite a bit
The Midgard project team is building a content-management system with PHP and
MySQL. If you need content management, http://www.midgard-project.com is
definitely worth a look. Or you can just work on the application we created in
Phorum (www.phorum.org) has an excellent discussion server written in PHP and
MySQL. You might want to compare it to the threaded discussion application in
Of the many Web-development sites that have PHP articles, tutorials, and code,
weberdev.com (http://weberdev.com/) is among the most extensive.
Both Brad and Jay have worked at Webmonkey. Jay is a former producer of the site,
and Brad has written several articles. Check out its PHP-related material at
Appendix I: PHP and MySQL Resources 695
Thereâ€™s no shortage of resources here either. Weâ€™ve mentioned mainly Web-based
resources in this appendix; however, we must mention one hard-copy MySQL
resource. Jay Greenspan, the co-author of this book, also wrote MySQL Weekend
Crash Course (Wiley 2002).
Predictably, this is probably the best place to find answers to any questions you
might have about MySQL. Some specific portions of the site are worth particular
â—† Downloads (http://www.mysql.com/downloads/) â€” This is the place to
find the latest version of MySQL in all the popular formats, including
rpms, source code, and Windows binaries.
â—† Contributions (http://www.mysql.com/downloads/contrib.html) â€”
A lot of developers have put together tools that you might be able to use
when working with MySQL. Of these, the GUI clients are particularly
â—† Documentation (http://www.mysql.com/documentation/) â€” The online
manual for MySQL is pretty good and available in several languages. It
covers many topics that this book did not. For example, the manualâ€™s
language reference should be bookmarked on your browser.
Both PHP and MySQL have downloadable HTML manuals. We keep them on
our local machine so we donâ€™t have to connect to the Web every time we
have a question.
The MySQL mailing list is monitored by many of the core developers. If you have a
question about the product and post it on the mailing list, someone who is working
on the product itself will surely see it. In addition, theyâ€™re really a very nice bunch
of guys. Information about subscribing to any of the mailing lists can be found
here: http://www.mysql.com/documentation/lists.html. A searchable archive
of the mailing lists can be found here: http://lists.mysql.com.
696 Part V: Appendixes
General Client-Side Resources
Here are a few of the sites we find ourselves returning to frequently.
HTML 4.0 character entity references
About the most comprehensive list we know of can be found here: http://
Netscapeâ€™s tag reference
If you are still dealing with the mess that is Netscape 4, this tag reference should be
of some assistance:
Apache will likely be your Web server, and when you are new to it, it can be tricky.
Apache.org (www.apache.org) is the home site for the Apache Software Foundation,
which is now working on many interesting projects. In particular, some very cool
things are happening in the XML space. Apache can be opaque when you first come
to it, but when you grow accustomed to using its documentation, you will see that
it really isnâ€™t very difficult to work with.
MySQL Function Reference
MYSQL and only some of these were used in the course of
HAS MANY FUNCTIONS,
this book. You should, however, have a good idea of what other MySQL functions
are available, as you might find they come in handy at times. To see the complete
MySQL function reference check out MySQL ABâ€™s documentation at http://
String Comparison Functions
This set of functions should not be confused with PHPâ€™s string handling functions.
Normally, if any expression in a string comparison is case-sensitive, the compari-
son is performed in a case-sensitive way.
This function conducts a pattern match using basic SQL wildcard characters:
expr LIKE pattern
With like you can use the following two wildcard characters in the pattern: %,
which matches any number of characters, even zero characters, and _, which
matches exactly one character. To test for literal instances of a wildcard character,
precede the character with the escape character, usually a backslash (\).
In MySQL you can specify a different escape character, but this is rarely useful.
This function returns 1 (true) if the pattern is found or 0 (false) if not:
mysql> select â€˜jay greenspanâ€™ like â€˜jay%â€™;
| â€˜jay greenspanâ€™ like â€˜jay%â€™ |
1 row in set (0.00 sec)
698 Part V: Appendixes
A NOT LIKE pattern match uses the same syntax and escaping as like.
expr NOT LIKE pattern
As you could probably have predicted, NOT LIKE returns true if the pattern and