News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Populating datagrid techniques with PHP
July 19, 2011 @ 09:25:46

In a new post to his blog Gonzalo Ayuso looks at the code required to populate a jQuery data grid with the records as pulled from a (MySQL) database.

Today I want to speak about populating datagrid techniques with PHP. At least in my daily work datagrids and tabular data are very common, because of that I want to show two different techniques when populating datagrids with data from our database. Maybe it's obvious, but I want to show the differences.

He uses "old school spaghetti code" rather than a framework to keep things simple and pulls the data from the database with a PDO connection. This information is then manually pushed into an HTML table and the data grid functionality is applied to it. The other method involves a little bit of JSON magic that the data grid library pulls in and populates for you, still appending rows to a table.

He notes that the second method seems faster to the user since the page and table are rendered first, but it also comes at the cost of more than one HTTP request.

0 comments voice your opinion now!
datagrid jquery technique preload ajax json


Internet Super Hero Blog:
PHP 5.3 Persistent Connections with ext/mysqli
February 19, 2009 @ 09:31:33

The Internet Super Hero blog has posted some statistics comparing the connections per second that can be made with the newly introduced persistent connection support coming with PHP 5.3 in the mysqli (ext/mysqli) driver.

Persistent Connections have been a mixed bag. They can give you a significant performance boost by caching (pooling) connections although MySQL is already comparatively fast at establishing connections. However,connections are stored "as-is" in the cache. They are not "cleaned up".

The ext/mysqli driver takes care of this and a few other problems surrounding the persistent connections by cleaning up things like rolling back active transactions, unlocking tables, closing prepared statements and closing handlers. The trick is in a call to the C-API function mysql_change_user() (= COM_CHANGE_USER).

0 comments voice your opinion now!
mysqli ext driver persistent connection trouble solved statistic


Zend Developer Zone:
Creating Data Tables With PEAR Structures_DataGrid
January 28, 2008 @ 16:19:30

Cal Evans has posted a tutorial on the Zend Developer Zone (posted today) about using the PEAR Structures_DataGrid package to create quick and easy data tables.

In this article, I'll be introducing you to the Structures_DataGrid package, showing you how it can be used to display structured data in tabular form. I'll be showing you how to hook it up to various data sources (including a CSV file, an RSS feed and an Excel spreadsheet), and how to format the resulting output so it's as pretty (or as ugly) as you want it to be.

They talk about what you'll need to get started (the different packages for different kinds of data) and some sample code to help you down the path to more attractive tables. There's even a bit touching on some of the more advanced features like exporting to Excel, pagination and data sorting.

0 comments voice your opinion now!
pear package structure datagrid table tutorial


Richard Thomas' Blog:
jQPie and Ext
April 19, 2007 @ 09:21:00

Richard Thomas reports on the latest functionality to be implemented with his jQPie framework - Ext support.

I had planned on building some extra functionality into jQPie to fit certain needs but after playing with Ext and its jQuery support all my needs have been met. A basic example of the paging/data grid module running off php, works pretty nice. http://projects.cyberlot.net/jqpie/examples/paging.html

The jQPie project provides a lightweight interface to iQuery. Check out some examples of what it can do on its wiki page.

0 comments voice your opinion now!
jqpie framework lightweight ext support jquery jqpie framework lightweight ext support jquery


DevShed:
Iterators in the Simplest Sense - Traversing Data Structures in PHP 5
March 23, 2006 @ 07:26:35

Wrapping up their series on Iterators in PHP, DevShed has posted Traversing Data Structures in PHP 5 - a look a combining embedded classes with the SPL to work through your data.

Welcome to the final part of the series "Iterators in the Simplest Sense." In this set of articles, you'll learn the basic concepts of iterators in PHP 4 and PHP 5. The overall learning experience is strongly focused on the practical sense of the topic, so you can start quickly using iterators within your own PHP applications.

In this last article I'll explore the implementation of PHP 5 iterators, by utilizing some of the embedded classes that integrate the powerful SPL package. Thus you can learn quickly how to include these programming structures inside your PHP applications.

They jump right in and start working with the SPL functions to create a simple, readable iterator class ("FileIterator"). They follow this with two examples building on the class - one that works with data from a text file, and the other from a MySQL database.

0 comments voice your opinion now!
iterator traversing data structures php5 fileiterator iterator traversing data structures php5 fileiterator


DevShed:
Iterators in the Simplest Sense - Traversing Different Data Structures
March 15, 2006 @ 12:50:40

DevShed has posted the second part in their "Iterators in the Simplest Sense" series - this time focusing on traversing different data structures.

Welcome to the second tutorial of the series "Iterators in the simplest sense." Just in case you didn't know, this series introduces Iterators in PHP 4 - PHP 5, explaining their basic concepts, and teaches you how to use them in practical projects, which can be utilized as part of larger PHP applications.

By the end of this tutorial, I hope you'll have an accurate idea of how to use a generic Iterator structure. I will show how it is useful for traversing different data structures by providing specific implementations for each of the abstract methods defined within the base Iterator class.

They look first at extending the code that they had before by making an interator to work with a MySQL connection. They discuss how it will all work prior to coding (plan first, code later) before moving into the actual coding process and creating the class. The iterator, once extended, provides an interface between you and the normal MySQL functions, making it easier to handle the results from your queries (with things like "countAffectedRows" and "seekRow").

0 comments voice your opinion now!
iterators data structures files mysql iterators data structures files mysql



Community Events





Don't see your event here?
Let us know!


deployment release community zendserver library framework interview update podcast api series language install symfony laravel opinion package list tips introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework