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

Chris Jones:
Using PHP and Oracle Database 12c Implicit Result Sets
July 26, 2013 @ 09:12:40

Chris Jones has a new post to his site showing you how to use Oracle 12c's implicit result sets in your code. Note: this functionality is still in development, so the naming/exact functionality might change.

The new Oracle Database 12c "Implicit Result Sets" (IRS) feature allows query results to be returned from a stored PL/SQL procedure (or a PL/SQL anonymous block) without requiring special PHP code. Support for IRS is available in PHP OCI8 2.0.0-devel extension when it is compiled and used with Oracle Database 12c. (OCI8 2.0 can be compiled and used with other versions of Oracle Database but the available feature set is reduced).

He shows a normal fetch loop that calls the oci_* functions and grabs each row with a oci_fetch_row call. He updates this to use an anonymous PL/SQL block (a string) instead that allows for more flexibility. He includes examples that fetch from one table, multiple tables and returns multiple result sets (that can be fetched one at a time) from the same single call.

0 comments voice your opinion now!
implicit result set oracle 12c tutorial multiple single sql plsql

Link: https://blogs.oracle.com/opal/entry/using_php_oci8_2_0

Johannes Schluter's Blog:
mysqlnd plugins and json
September 14, 2011 @ 11:04:48

Johannes Schluter has shared a handy mysqlnd plugin that he's written up that does two common things at once when you're pulling data from your database and pushing it into JSON - a mysqlnd_query_to_json function.

In my spare time I'm currently writing a shiny Web 2.0 application where I'm heavily using AJAX-like things, so what I do quite often in this application is, basically this: Check some pre-conditions (permissions etc.) then select some data from the database, do a fetch_all to get the complete result set as an array and run it through json_encode; Of course that example is simplified as I'm using the Symfony 2 framework for this project. [...] So I wrote a mysqlnd plugin.

His plugin (that he admits is "a hack") gives you the mysqlnd_query_to_json function that automagically transforms the results from the passed in query into JSON output. He notes some things lacking - like Unicode encoding and no MySQL bitfield support.

0 comments voice your opinion now!
mysqlnd json plugin convert result


SitePoint PHP Blog:
Sophisticated Object Iterators in PHP
May 05, 2011 @ 12:54:59

Following up on their earlier simple object iterators post, the SitePoint PHP blog is back with a look at more sophisticated iterators you can use to work with database record objects.

In my previous post, Simple Object Iterators in PHP, we discovered how to iterate over array items defined within an object using a foreach loop. However, what if you need to iterate over items which are not stored in an array, e.g. records from a database or lines of text read from a file?

He shows how to create a script that pulls in the users from a database object (PDO, in this case) and implements the Countable and Iterator interfaces. These interfaces give it some special methods that can give counts of the results and help you iterate through the results - current, rewind, next and valid.

0 comments voice your opinion now!
object iterator spl database result pdo countable implement


Chris Jones' Blog:
More on PHP and Oracle 11gR2 Improvements to Client Result Caching
March 04, 2011 @ 09:56:33

Chris Jones has posted more information to his Oracle blog about the caching and other improvements that come along with the Oracle 11gR2 release that can be used in PHP applications.

Oracle 11.2 brought several improvements to Client Result Caching. CRC is way for the results of queries to be cached in the database client process for reuse. [...] PHP OCI8 as a "client" of the database can use CRC. The cache is per-process, so plan carefully before caching large data sets. Tables that are candidates for caching are look-up tables where the network transfer cost dominates.

Like many of the other server-side tools Oracle has to offer, it's pretty simple to enable this caching. Before you had to add a custom bit to your query to tell it to enable the caching. Now it's as simple as setting it up on the CREATE or ALTER for the table - nothing extra for the developer to do.

0 comments voice your opinion now!
oracle caching client result create alter


Kevin Schroeder's Blog:
What to make of TIOBE's PHP results
March 03, 2011 @ 12:20:29

Kevin Schroeder has some of his own thoughts on the recent results of the TIOBE index ranking the popularity of programming languages. PHP has slopped down two spots, replaced by Python and C++. He looks at the data TIOBE has to back it up and can't seem to find a reason why.

I decided to take a look and see what was going on behind the scenes by reading on the index definition to see if I could understand what happened. After reading through the definition I still don't know what happened, or even why it happened.

He goes through how the index data is created - search results from the top 6 hits in Alexa for each language result - and how he, basically, found nothing out of the ordinary. He points out that, because of inconsistencies like this, the TIOBE index shouldn't be regarded as much more than a loose guide. Since it's based on hard-coded search strings, it'll never be a true judge of "popularity" overall.

0 comments voice your opinion now!
tiobe popularity result drop python c


Chris Jones' Blog:
PHP OCI8 and Oracle 11g DRCP Connection Pooling in Pictures
February 22, 2011 @ 10:44:46

Chris Jones has posted some "pictures" of the performance that an Oracle database sees when it uses the connection pooling versus the normal connect/allocate sort of connection with the Oracle OCI8 driver for PHP. As you can see, the differences in memory consumption are huge.

Here is a screen shot from a PHP OCI8 connection pooling demo that I like to run. It graphically shows how little database host memory is needed when using DRCP connection pooling with Oracle Database 11g. Migrating to DRCP can be as simple as starting the pool and changing the connection string in your PHP application.

He also describes the differences between the pooled and non-pooled connections (to the developer it's as easy as putting ":pooled" in the connect string) in his graphs, and notes that using the pooling doesn't just have to be for large site - smaller sites can benefit too.

0 comments voice your opinion now!
oci8 oracle connection pooling performance graph result


W3Techs.com:
Highlights of web technology surveys, Nov. 2010 3/4 of all websites are based on PHP
November 03, 2010 @ 10:19:30

According to a new article on the W3Tech.com site today, around three quarters of all websites are based on PHP. They've run their own survey to gather the results about the use of several different languages like ASP.NET, Java, Ruby and, of course, PHP.

Our server-side programming language survey shows that a very remarkable 74.9% of websites use PHP, slightly increasing in the last year. ASP.NET technologies (presumably mostly C#) come in second, and a few percentages are left for Java. That's about it. The variety of programming languages used to develop websites is surprisingly small, considering that everyone and his dog develops websites these days. There is a lot of talk in the IT blogoshere about alternative languages such as Ruby and Python, but their real world usage is tiny compared to PHP.

They talk about some of the contributing factors to these numbers including the wide use of various PHP-based content management systems, the balance of high traffic versus low traffic sites and some breakdowns according to operating system, geographical area and a hint at how their survey operates to find the systems using PHP.

0 comments voice your opinion now!
survey usage result programming language website


Andrey Hristov's Blog:
Replacing mysqli's Connection, Result and Statement classes
July 09, 2010 @ 10:31:03

On his blog today Andrey Hristov has a quick post that talks about two methods to extend the functionality that the mysqli extension offers in PHP with your own custom code.

Have you ever though about extending mysqli's classes. It's pretty simple to subclass the connection class mysqli. However, subclassing mysqli_result and mysqli_stmt is not so obvious, actually I though that it's even not possible. However, never say never! After discussing mysqli's OO interface for an hour yesterday [...] I found out how one can plug his own classes.

Two code examples are provided - one for extending the mysqli_result and the other extending the mysql_stmt class. You can find more about these and other classes the mysqli extension has to offer in this section of the PHP manual.

0 comments voice your opinion now!
replace mysqli connection result statement class extend


Stoimen Popov's Blog:
preg_match Give Names to the Matches
July 06, 2010 @ 11:01:48

In a quick post to hos blog today Stoimen Popov points out a handy feature of the preg_match function in PHP (in PHP 5.2.2 and higher) to be able to name the results of the regular expression match.

In PHP 5.2.2+ you can name the sub patterns returned from preg_match with a specific syntax. [...] This is extremely helpful, when dealing with long patterns. [...] Although it may look difficult to maintain, now you can simply name the sub patterns of preg_match and to call them with their associative array keys. This is more clear when writing code and it's definitely more maintainable.

The key is to use a special syntax as a part of the expression's pattern. This replaces the numeric keys of the matches with values you define, making it simpler to use the results (instead of having to work with numbers that don't match much of anything). Code and expression examples are included.

0 comments voice your opinion now!
named result match pregmatch regularexpression


PEAR Blog:
The new Group has been elected!
August 11, 2009 @ 07:51:10

According to this new post on the PEAR blog, the new PEAR Group has been officially elected:

I am more than glad to announce the arrival, the announcement of the new PEAR Group for 2009 and 2010. With a few fresh faces in the Group, this year looks very promising with the mix of both new blood and experienced PEAR Group members.

Those selected include Chuck Burgess, Ken Guest, Christian Weiske and Brett Bieber. The PEAR Group helps to guide the PEAR project as a while and push out initiatives like the updated package manager - Pyrus.

0 comments voice your opinion now!
election result pear group



Community Events





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


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

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