<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META NAME="GENERATOR" CONTENT="lfparser_2.35"> <META NAME="LFCATEGORY" CONTENT="Webdesign"> <link rel="icon" href="../../common/images/lf-16.png" type="image/png"> <TITLE>lf280, Webdesign: Bookreview: Beginning PHP4 Databases</TITLE> <style type="text/css"> <!-- td.top {font-family: Arial,Geneva,Verdana,Helvetica,sans-serif; font-size:12 } pre { font-family:monospace,Courier } pre.code { font-family:monospace,Courier;background-color:#aedbe8; } p.cl { color:#EE9500 } a.nodec { text-decoration:none } p.trans { font-size:8pt; text-align:right } p.clbox { width:50%; alignment:center; background-color:#FFD700; border-style:none; border-width:medium; border-color:#FFD700; padding:0.5cm; text-align:center } p.code { width:80%; alignment:center; background-color:#aedbe8; border-style:none; border-width:medium; border-color:#aedbe8; padding:0.1cm; text-align:left } p.foot { background-color:#AAAAAA; color:#FFFFFF; border-style:none; border-width:medium; border-color:#AAAAAA; padding:0.5cm ; margin-top:0.1cm; margin-right:1cm; margin-left:1cm; text-align:center } .mark { background-color:#e6e6ff } --> </style> </HEAD> <BODY bgcolor="#ffffff" text="#000000"> <!-- this is generated html code. NEVER use this file for your translation work. Instead get the file with the same article number and .meta.shtml in its name. Translate this meta file and then use lfparser program to generate the final article --> <!-- lfparser can be obtained from http://www.linuxfocus.org/~guido/dev/lfparser.html --> <!-- this is used by a number of tools: =LF=AUTHOR: Alessandro Pellizzari =LF=CAT___: Webdesign =LF=TITLE_: Bookreview: Beginning PHP4 Databases =LF=NUMBER: 280 =LF=ANAME_: article280.shtml --> <!-- 2pdaIgnoreStart --> <!-- start navegation bar --> <!-- top navegation bar --> <TABLE summary="topbar_1" cellspacing="0" cellpadding="0" border="0" align="center" width="90%"> <TR bgcolor="#2e2292"> <TD class="top"><TABLE summary="topbar_1_logo" cellspacing="0" cellpadding="0" border="0" width= "100%"> <TR><TD width="319"><IMG src="../../common/images/logolftop_319x45.gif" alt="[LinuxFocus-icon]" width="319" height="45" align="left" border="0"></TD> <TD class="top"> <TABLE summary="topbar_1_links" width="100%"> <TR align="right"> <TD class="top"><A class="nodec" href="../index.shtml"><FONT color= "#DDDDDD" size="2">Home</FONT></A> | <A class= "nodec" href="../map.html"><FONT color= "#DDDDDD" size="2">Map</FONT></A> | <A class= "nodec" href="../indice.html"><FONT color= "#DDDDDD" size="2">Index</FONT></A> | <A class="nodec" href="../Search/index.html"><FONT color= "#DDDDDD" size="2">Search</FONT></A> </TD> </TR> <TR align="right"> <TD class="top"> <HR width="100%" noshade size="1"> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </TD> </TR> </TABLE> <!-- end top navegation bar --> <!-- blue bar --> <TABLE summary="topbar_2" cellspacing="0" cellpadding="0" border="0" align="center" width="90%"> <TR bgcolor="#00ffff"> <TD><IMG src="../../common/images/transpix.gif" width="1" height= "2" alt=""></TD> </TR> </TABLE> <!-- end blue bar --> <!-- bottom navegation bar --> <TABLE summary="topbar_3" cellspacing="0" cellpadding="0" border="0" align="center" width="94%"> <TR bgcolor="#000000"> <TD> <TABLE summary="topbar_3_links" cellspacing="0" cellpadding="1" border="0" width= "100%"> <TR align="center"> <TD WIDTH="20%"><A class="nodec" href="../News/index.html"><FONT color= "#FFFFFF">News</FONT></A> </TD> <TD WIDTH="5%"><FONT color="#FFFFFF">|</FONT> </TD> <TD WIDTH="20%"><A class="nodec" href="../Archives/index.html"><FONT color= "#FFFFFF">Archives</FONT></A> </TD> <TD WIDTH="5%"><FONT color="#FFFFFF">|</FONT> </TD> <TD WIDTH="20%"><A class="nodec" href="../Links/index.html"><FONT color= "#FFFFFF">Links</FONT></A> </TD> <TD WIDTH="5%"><FONT color="#FFFFFF">|</FONT> </TD> <TD WIDTH="20%"><A class="nodec" href="../aboutus.html"><FONT color= "#FFFFFF">About LF</FONT></A> </TD> </TR> </TABLE> </TD> </TR> </TABLE> <!-- end bottom navegation bar --> <!-- stop navegation bar --> <!-- SSI_INFO --> <!-- tr_staticssi include virtual --> <!-- tr_staticssi exec cmd --> <!-- addedByLfdynahead ver 1.4 --><TABLE ALIGN="right" border=0><TR><TD ALIGN="right"><FONT SIZE="-1" FACE="Arial,Helvetica">This document is available in: <A href="../../English/March2003/article280.shtml">English</a> <A href="../../Castellano/March2003/article280.shtml">Castellano</a> <A href="../../Deutsch/March2003/article280.shtml">Deutsch</a> <A href="../../Francais/March2003/article280.shtml">Francais</a> <A href="../../Italiano/March2003/article280.shtml">Italiano</a> <A href="../../Nederlands/March2003/article280.shtml">Nederlands</a> <A href="../../Portugues/March2003/article280.shtml">Portugues</a> <A href="../../Russian/March2003/article280.shtml">Russian</a> <A href="../../Turkce/March2003/article280.shtml">Turkce</a> </FONT></TD></TR></TABLE><br> <!-- SSI_INFO STOP --> <!-- 2pdaIgnoreStop --> <!-- SHORT BIO ABOUT THE AUTHOR --> <TABLE ALIGN=LEFT BORDER=0 WIDTH="190" summary="about the author"> <TR> <TD> <!-- 2pdaIgnoreStart --> <!-- PALM DOC --> <TABLE BORDER=0 hspace=4 vspace=4 summary="pda download"> <TR> <TD> <font size=1> <img src="../../common/images/2doc.gif" width=34 align=left border=0 height=22 alt="convert to palm"><a href="http://cgi.linuxfocus.org/cgi-bin/2ztxt">Convert to GutenPalm</a><br>or <a href="http://cgi.linuxfocus.org/cgi-bin/2pda">to PalmDoc</a></font> </TD> </TR> </TABLE> <!-- END PALM DOC --> <!-- 2pdaIgnoreStop --> <br> <img src="../../common/images/AlessandroPellizzari.jpg" width="180" height="242"alt="Alessandro"> <BR>by Alessandro Pellizzari <br> <small><alex(at)neko.it></small> <BR><BR> <I>About the author:</I><BR> <!-- aboutauthor_start --> <P> Alessandro has been a Linux System Administrator and Programmer for some time, after using various Amiga computers with satisfaction. He is mainly interested in PHP, Python and C programming but always seeking new interesting fields in computer science. </P> <!-- aboutauthor_stop --> <!-- TRANSLATED TO en --> <!-- TRANSLATED TO STOP --> <BR><i>Content</i>: <UL> <LI><A HREF="#280lfindex0">Introduction</A></LI> <LI><A HREF="#280lfindex1">Organization of the book</A></LI> <LI><A HREF="#280lfindex2">Pros</A></LI> <LI><A HREF="#280lfindex3">Cons</A></LI> <LI><A HREF="#280lfindex4">Conclusions</A></LI> <LI><A HREF="#280lfindex5">References</A></LI> <LI><A HREF="http://cgi.linuxfocus.org/cgi-bin/lftalkback?anum=280">Talkback form for this article</A></LI> </UL> </TD></TR></TABLE> <!-- HEAD OF THE ARTICLE --> <br> <table border="0"><tr><td> <H2>Bookreview: Beginning PHP4 Databases</H2> <img src="../../common/images/illustration280.gif" width="160" height="200" alt="[Illustration]" HSPACE=10> <!-- ABSTRACT OF THE ARTICLE --> <P><i>Abstract</i>: <P> <!-- articleabstract_start --> This article is a review of the new Wrox book on implementing and using database systems with PHP4. <!-- articleabstract_stop --> <br><!-- HR divider --><center><font color="#8282e0"><b>_________________ _________________ _________________</b></font></center><br> </td></tr></table> <!-- BODY OF THE ARTICLE --> <A NAME="280lfindex0"> </A> <H2>Introduction</H2> <p>Nowadays the majority of PHP web sites are based upon one or several databases. But how many of the programmers really know how a relational database work, the possibilities they offer, how to optimize data access time and the object-relational extensions?</p> <p>This book is a good starting point for programmers wanting to develop database-oriented web applications, to provide the reader the necessary foundations to choose the database to use and the techniques to choose the best table structure and access methods.</p> <A NAME="280lfindex1"> </A> <H2>Organization of the book</H2> <p>The book is composed of 13 chapters and 3 appendices, plus a fourteenth chapter available online at <a href="http://www.wrox.com">Wrox</a>.</p> <p>After a brief introduction to the book explaining the structure and listing the online resources, the first chapter is a fast introduction to PHP, deeply analyzing only the object-oriented part of the language. The second chapter focuses on database fundamentals, explaining various DB models and their evolution through history, to come to the modern RDBMS, their object-extensions and the XML databases. This chapter continues touching upon how to access databases with PHP, listing the supported databases and the PHP compile-time options to support them. </p> <p>Starting from chapter three the book goes into database structure, explaining table normalization and giving a brief introduction to Entity-Relation diagrams, to come on chapters four and five to a deeper explanation of SQL respectively describing structure creation and data insertion, modification and querying. The sixth chapter finally introduces typical RDBMS characteristics as referential integrity, triggers and transactions. </p> <p>Chapter seven goes back to PHP programming with a discussion on how to integrate advanced SQL into PHP scripts, describing, among others, cursors, triggers, views and indexes. On chapter eight we find an introduction to multi-tier development with PHP and an analysis of the available function and classes libraries abstracting database access. Chapter nine goes into deeper explanation of PEAR::DB, which will be used in the rest of the book for all the examples.</p> <p>Chapter ten is entirely dedicated to a case study: a PEAR:DB-based application for invoice recording and payment-tracking, starting from the analysis of the problem, going through required tables definition and finally writing the application code.</p> <p>The following chapter is similarly structured, studying a library management application, using object-relational databases, particularly PostgreSQL. It starts analyzing the problem, then defines the table structure, but the application code, due to space limitation, is only available from the Wrox website site.</p> <p>From chapter twelve the argument shifts toward XML databases, listing pros and cons in respect of relational DB. There in a list of different implementations, both commercial and free, and in the end Xindice from Apache Software Foundation is discussed. <br> The explanation goes from the database creation to its filling using XML documents, analyzing then XPath and XUpdate technologies for data query and update, giving a brief introduction to the emerging XQuery.</p> <p>Chapter thirteen takes from chapters ten and eleven its structure, studying from problem analysis to the realization a recipe exchange application, with privilege separation for normal user and administrator. </p> <p>The appendices are mainly dedicated to database administration, data backup strategies, optimization, PHP DB access functions and Apache, PHP and iODBC installation under Linux/Unix.</p> <A NAME="280lfindex2"> </A> <H2>Pros</H2> <p>The authors don't go too deep, as others do, into the syntax or a PHP introduction, which can be better explained in dedicated books, and focus from the beginning on the main subject: databases and PHP integration.<br> The example code is clear and well-commented both in-line and out-of-code.<br> Within the examples you will find useful tricks and tips. <br> The book site (see references at the end of the article) is really useful to find errata and to download the source code of all the book examples,and provides an example chapter to read.</p> <A NAME="280lfindex3"> </A> <H2>Cons</H2> <p>There are some typos within the text, maybe annoying especially the non-English reader, but they are not in the code, giving no problems with the examples.<br> On the book's web site you will find the errata with the corrections (see references at the end of the article).<br> There isn't (yet) "Professional PHP4 Databases", and for really special cases there is a need of deeper analysis of some arguments, that because of their complexity haven't been inserted into this book, given its "beginners"-oriented nature.</p> <A NAME="280lfindex4"> </A> <H2>Conclusions</H2> <p>The book perfectly hits the bull's eye, a good base for the database usage in PHP applications and good analysis techniques with regard to table structure. <br> A great number of the issues within the book are too often ignored by programmers, that would certainly give big advantages with regards to security, structure and speed. </p> <p>This book is highly recommended reading for everyone wanting to begin using databases in PHP4 applications, but even and mainly to those already using them but not having received a good training on their efficient use.</p> <A NAME="280lfindex5"> </A> <H2>References</H2> <ul> <li><a href="http://www.wrox.com/books/1861007825.htm">The editor's page of the book</a></li> <li><a href="http://www.wrox.com/dynamic/books/errata.aspx?isbn=1861007825">Book errata with corrections</a></li> </ul> <!-- vim: set sw=2 ts=2 et tw=74: --> <!-- 2pdaIgnoreStart --> <A NAME="talkback"> </a> <h2>Talkback form for this article</h2> Every article has its own talkback page. On this page you can submit a comment or look at comments from other readers: <center> <table border="0" CELLSPACING="2" CELLPADDING="1" summary="tb-button-outerpart"> <tr BGCOLOR="#C2C2C2"><td align=center> <table border="3" CELLSPACING="2" CELLPADDING="1" summary="tb-button"> <tr BGCOLOR="#C2C2C2"><td align=center> <A href="http://cgi.linuxfocus.org/cgi-bin/lftalkback?anum=280"><b> talkback page </b></a> </td></tr></table> </td></tr></table> </center> <HR size="2" noshade> <!-- ARTICLE FOOT --> <CENTER><TABLE WIDTH="98%" summary="footer"> <TR><TD ALIGN=CENTER BGCOLOR="#9999AA" WIDTH="50%"> <A HREF="../../common/lfteam.html">Webpages maintained by the LinuxFocus Editor team</A> <BR><FONT COLOR="#FFFFFF">© Alessandro Pellizzari, <a href="../../common/copy.html">FDL</a> <BR><a href="http://www.linuxfocus.org">LinuxFocus.org</a></FONT> </TD> <TD BGCOLOR="#9999AA"> <!-- TRANSLATION INFO --> <font size=2>Translation information:</font> <TABLE summary="translators"> <tr><td><font size="2">it --> -- : Alessandro Pellizzari <small><alex(at)neko.it></small></font></td></tr> </TABLE> </TD> </TR></TABLE></CENTER> <p><font size=1>2003-03-02, generated by lfparser version 2.35</font></p> <!-- 2pdaIgnoreStop --> </BODY> </HTML>