WebReference.com: Database-enabled Ajax with PHP
6134
In this new tutorial from WebReference, they show you how to develop a simple database-enabled Ajax application in PHP.   In this article you'll learn how to create database-enabled Ajax requests using PHP and MySQL. We begin by creating the front-end HTML and JavaScript files used to make requests to the server-side. The requested server-side is a PHP file which bridges the gap between Ajax and a PHP object that connects to a MySQL database and returns results as an XML response to the Ajax engine.   The application is a simple way to enter news postings into a database and pull them back out with this handy Javascript functionality. They also provide the complete source code for download to help you get started.
708667
Lorenzo Alberton is back today with another tutorial dealing with the PEAR::Pager class. This time, he focuses on using it with some simple Javascript and Ajax.    Not everyone has jumped on the (Ajax) bandwagon, though, and many libraries still exist without implementing this feature, so you're faced with the dilemma: should I keep using that old library and give up my cool AJAX ideas, or should I implement my own version?   If you're looking for a pager class with these requisites, I'm happy to reassure you about PEAR::Pager: it is AJAX-ready, and has been since a long time ago. 100% buzzword-compliance guaranteed!    He gives two examples of what he means - one just using the Pager package to create Javascript lists and divide them into paginated chunks and the other to work with an Ajax connection (via PEAR::HTML_AJAX) to grab the data and push it into a container DIV on the page.
762394
Christopher Jones talkes about some updates that he's made to the default PDO functionality of PHP, adding in a few things like pre-fetching and methods to get the details of the database server you're using.   After PHP 5.2.4 shipped and a new release cycle began, I merged a couple of enhancements to PDO_OCI attribute handling.  Specifically I added $dbh->getAttribute() support for ATTR_SERVER_VERSION, ATTR_SERVER_INFO, ATTR_CLIENT_VERSION and. ATTR_AUTOCOMMIT.  At the moment these are only available in the PHP snapshots on http://snaps.php.net/. Let me know if there are any issues so they can be resolved before the next PHP release.   He gives examples of two things - the pre-fetching functionality, allowing for better optimization for a query, and the transaction management features, making it as simple as a try{} block to test the commit and rollback if needed.   He also mentions other properties/attributes included in the new release - ATTR_PERSISTENT, ATTR_TIMEOUT, ATTR_ORACLE_NULLS, ATTR_CASE and ATTR_ERRMODE, ATTR_SERVER_VERSION and ATTR_CLIENT_VERSION (the last two have examples).
743840
Chris Shiflett has posted his own recap of the (just passed) php|works conference up in Toronto over on his blog.   I've been traveling non-stop since php|works, so I haven't had a chance to reflect on the conference, what I learned, who I met, and things like that. (Zak has been doing a good job of this lately, and I'd like to follow his lead.) I've probably forgotten more than I remember, but this is my recap.   Included in the things he mentions are:  The people he was able to meet (like Joshua Eichorn and Sebastian Bergmann) The talks he gave ("Truth about XSS" and "Agile PHP Testing") His interview with Cal Evans of the Zend Developer Zone The PHP 5 Certification and Wez Furlong's "Not PDO" talk
150071
On his blog today, Mike Lively has posted about the work h's done to create a database extension for the popular unit testing software for PHP, PHPUnit.   For those that may not have read any of my previous postings on the subject the goal of this software is to extend the functionality of PHPUnit to allow using seed data to put a given database into a known state prior to executing each test. It also provides an easy mechanism to compare database contents with an expected dataset.   Mike has just completed the initial feature set for his project - more or less a port of DBUnit over to PHP. The post includes not only details about this initial release but also code that demonstrates its use. In his example, it's used to validate that a bank account has been created properly by comparng database information before and after the insert.
703914
On his blog, Stuart Herbert has a quick tip showing how to mimic a feature of Ruby on Rails:   I'm still working on the next article in my series looking at PHP on servers, so in the mean time, check out this simple way to emulate Ruby's nice way of handling separate getter, setter and state query methods in PHP.   He admits his example isn't as elegant as the Ruby method, but it does get the job done. Code for the method is included in his post ready for cut and pasting.
41064
Gerd Schauffelberger writes on the PHP-Tools Blog today about the contents of the latest issue from the German PHP Magazine, specifically an article covering the PEAR package HTML_AJAX.   This article's target is (1st) to give a brief introduction to AJAX and how things work from Javascript an PHP side in contrary. Also (2nd) I wanted to show that you actually don't have to muck around with a mess of Javascript (browser compatibility issues and such) because it's it is all done by the Joshua Eichorn's HTML_AJAX framework.    The article doesn't build up an entire application (as Gerd mentions) but it does provide you a good base to work from and gives you a good direction to head from to learn more about this powerful package.
583679
On PHPied.com, there's a new tutorial that combines the power of Ajax with the flexibility of PHP to create a more Ajax-centric version of an Model/View/Controller structure.    This is sort of a framework thing to create AJAX applications, based on the MVC design pattern. Yep, I have a lot of buzzwords here, I admit, but this shouldn't be taken too seriously. I was doing a bunch of small projects lately and I found myself using something like this little framework, without even thinking about it.    Then I thought about it and I found that the scripts and the organization of them may resamble MVC a bit. So how does MVC fit when you mix things like thin and fatter client, HTML, JavaScript, XMLHttpRequest, PHP and CSS?    He compares the "usual flow" of Ajax applications verus how an MVC-like app would work and shows a simple version of one in action. It uses PHP for the Model, Javascript/PHP for the Controller logic, and strictly HTML/CSS/Javascript for the View to output to the user. He incorporates some of the Yahoo! UI functionality to help capture events and make the backend Ajax connection. His sample sends off an Ajax request to the PHP backend when the button is pressed and takes in the message (HTML) and pushed it back out into the current page.   The demo is here and you can download the source as well.
463548
On the PHPClasses.org website there's a new entry covering, among other things, one handy feature PHP includes to let developers read and write their data more flexibly - streams.   This article explains what are stream handlers and how they simplify PHP developers lives by allowing PHP applications to easily read and write data from containers, like remote Web pages or e-mail messages, as if they were files. [...] The article also presents more examples of cool stream handlers classes submitted to the PHPClasses site by several authors.   He describes the abstraction that the streams interface allows, how they can make your life easier, a real-life example of streams in action (working with POP3) and some of the classes that have been contributed to PHPClasses.org that use them.
181316
From the Oracle Technology Network website, there's a new tutorial in the Oracle+PHP Cookbook series that focuses on using PHP and Oracle together with Ajax to create a simple HTML form example.   In this recipe, I discuss all the code necessary to use Ajax to go from a simple Web page to a JavaScript function to an XMLHttpRequest to a PHP script and, finally, to an Oracle database. Along with the code, I do talk about the individual pieces with respect to the whole picture: what each chunk does and why it's important. By reading this HowTo, you will acquire not only some sample code but also, hopefully, a broader understanding of the whole Ajax concept.   They step through the creation of the background database tables, including the insertion of some sample data. Next up is the creation of the query to run our check, then testing the script to ensure things are set up as they need to be, and finally, creating the front-end - writing the HTML and Javascript to make the form.    The end result is a simple form that, when the contents of the text field are changed, a message is sent back to the server to check and see if the email address entered already exists.
444294
DevShed launches a new tutorial series today with this new article, an introductory look at using the PDO objects in PHP5.   As you may have seen at first glance, the PDO extension looks really useful in certain situations. In this three-part series, I'm going to introduce its most important features, by accompanying the corresponding theoretical concepts with numerous hands-on examples, in this way facilitating the respective learning curve.   They start the series off with a look at using the extension and connecting to a resource (in their case, a MySQL database). Then, it's on to performing queries and grabbing the last inserted IDs for the rows your script just put in.
698334
Popular posts from PHPDeveloper.org for the past week:The Bakery: Six New Articles/Tutorials PostedEvert Pot's Blog: PHP: Arrays vs. ObjectsDevArticles: Learning AJAXInternet Super Hero: PHP: mysqli_fetch_all()David Coallier's Blog: PHP Namespaces (Part 1: Basic usage & gotchas)I/O Reader: 15 Cool Things & 12 Things to Dislike About PHPProPHP Podcast: Newscast - August 16, 2007PHPBuilder.com: Dynamic XML with PHPSite News: Popular Posts for the Week of 08.17.2007PRADO Watch Blog: PRADO Watch: Interview With Timani Tunduwani - Why I Moved From CakePHP to PRADO
676141
While attending Gunter Kniesel's "Aspect-Oriented Software Development" lecture yesterday it occured to me that it might be possible to (ab)use PHP 5's __autoload(), __call(), __get(), and __set() interceptors to facilitate Aspect-Oriented Programming with PHP.
493955
Tony Bibbs takes a look at an increasingly popular bit of functionality in PHP5, the SOAP extension, and notes that it still has a "ways to go".   In my latest round of web services work in PHP5 I was creating a PHP5 client that interacts with our Java-based ERP. The client needs to be a combination of a couple of WSDL's into one, nice, compact and powerful client. It should be noted this client will be distributed via the State of Iowa PEAR channel so it will undoubted by used by other project in our organization and throughout state government so the result needs to have a lot more fit-and-finish than would be typical.   He mentions his expectations for PHP's usage of the protocol, including the automatic generation of variables/methods/etc to help the developer use the remote application easier.
104778
Latest PHPClasses.org Releases:Multi-Dimensional Array HandlerMySQL2JSONBBCode ParsersphpcompilerProcessingExponsor ModSimplePagingweb20vnRouterSStatusMagic ArraysqlExecmyAltCaptchaDynamic Methodpreg_magic
86944
DevShed continues their tutorial series looking at working with PHP and databases today with more excerpted material from the O'Reilly book "Programming PHP, Second Edition" (by Kevin Tatroe, Rasmus Lerdorf, and Peter MacIntyre).   Picking up from where we left off last week, we'll be discussing shortcuts, query responses, metadata, and more.   They start off looking at shortcuts, those handy things the PEAR DB package offers to make life simpler (like getRow and getAssoc) before moving on to how to get the details about the response itself (like affectedRows and tableInfo). Next up is working with the metadata (using getListOf) and, finally, a sample application to tie them all together.
152445
Latest PHPClasses.org Releases:Flash MessagesRSS and Atom Feeds Processing APImabp::tagCloudUltimate MySQLerror_managerSingly Linked ListChinese Encode ConvertphpSortableASCII Art GeneratorPSPLMultiselectNiftyCubeAmazon ECS Webservicesimple Email ClassPHPDance