The series Using X with PHP mysqli continues. After notes on calling stored procedures and using prepared statements, its time for a multiple statement quickstart. A mighty tool, if used with carea
Using Multiple Statements with mysqli
MySQL optionally allows having multiple statements in one statement string. Sending multiple statements at once reduces client-server round trips but requires special handling.
Multiple statements or multi queries must be executed with mysqli_multi_query(). The...
Multiple PHP versions set-up
Monday, November 7th 2011, 09:11 GMT
For many of my projects (both hobby and commercial) I need to support many different PHP configurations. Not only just different PHP versions, but also debug builds, ZTS builds and 32-bit builds. In order to be able to test and build extensions against all those different PHP configurations I have adopted a simple method that I'm sharing with you here.
The major part of it is that I use a different installation prefix for...
I noticed that archivers/pecl-phar vanished from the ports tree on one of my FreeBSD servers.
Problem?Reasons to remove the port were:
the port is unmaintained
the port was based on the outdated phar extension from pecl
phar (in pecl) contains open security issues
The simple solution is to create a new port which of course will use the phar which is bundled in PHP's core. And I will get to that (but feel free to beat me at it ;-)).SolutionIn the meantime, here's a simple solution to get phar on...
Like many other projects, many components of PEAR have started a migration to github.
We have two primary organisations set up for PEAR and PEAR2.
While the existing PEAR packages will continue to use the pear.php.net distribution and bug tracking capabilities; it's never been easier to contribute to a PEAR package - simply fork; add your changes and send us a pull request.
If your preferred packages aren't yet on github, please feel free to drop us a line on the pear-dev mailing list.
One of the coolest things about working on Gimme Bar has been the opportunity to build a platform. While most folks interact with our service via the web site, the site is just one application built on top of the Gimme Bar content collection and curation system. Our web site interacts with the system via our HTTP API, which is open to everyone, not just our internal team. That means that anyone can build applications on top of our platform to suit their own needs or interests.To demonstrate this, I...
PECL/mysqlnd 1.1.2-stable has been released. The mysqlnd replication and load balancing plugin for PHP 5.3/5.4 finally got the download label it deserves: stable, ready for production use! PECL/mysqlnd_ms makes using any kind of MySQL database cluster easier.
Download PECL/mysqlnd from pecl.php.net
Documentation at the PHP Reference Manual
The release motto of the 1.1 series is aocover MySQL Replication basics with production qualitya, which shows that the plugin is optimized for...
Kevin Schroeder has a quick tip for anyone using phpcloud.com and having trouble with git and "remote end hung up" error messages.If you are using phpcloud.com and are experiencing errors with git [...] and you are trying to push large files (not sure what is defined as "large") you may need to change some git settings.He points out two settings - one for Windows and the other for Linux - that increase the buffer size to handle larger files that might be included in your repository.
Ulf Wendel has a new post today with details on using stored procedures with mysqli - not overly difficult if you know how to handle the IN, OUT and INOUT parameters. He includes a few code examples showing how to use them.Out of curiosity I asked another friend, a team lead, how things where going with their PHP MySQL project, for which they had planned to have most of their business logic in stored procedures. I got an email in reply stating something along the lines: "Our developers found that mysqli...
On DZone.com Giorgio Sironi has a new post talking about a development practice that's becoming more and more popular (rather than the old standby of one development platform for all developers) - using virtual machines as reusable, easily renewable platforms. He talks about the process he went through to set up PHP, including the commands used during the process.This is an occasion to learn about a virtualization tool which I'm not familiar with, VirtualBox. The goal is to install PHP 5.4, which is not...
PHPUnit is one of the most widely used unit testing tools for PHP applications. It comes packed with features, some that are commonly used and some not so much. In a new post to his blog today Volker Dusch looks at one specific feature - the "@covers" annotation you can use in your tests' comments to specify which functionality you're actually testing.One of the goals of your test suite and the coverage report is to make you trust in your code base and to remove the fear of changing something that needs...
Starting with PHP mysqli is easy, if one has some SQL and PHP skills. To get started one needs to know about the specifics of MySQL and a few code snippets. Using MySQL stored procedures with PHP mysqli has found enough readers to begin with a aoquickstarta or aohow-toa series. Take this post with a grain of salt. I have nothing against Prepared Statements as such, but I dislike unreflected blind use.
Using prepared statements with mysqli
The MySQL database supports prepared statements. A prepared...
In a new post to his blog today Anthony Ferrara looks at the (heated) discussion that's popped up around having the PSR-0 autoloader standard included as a part of the PHP core. He gives his reasons (three of them) why he's not for the decision.Recently there has been a rather heated and intense discussion on whether the PSR-0 autoloader "standard" should be included as part of the PHP core (in ext/spl to be exact). I've tried to stay out of the discussion and have successfully done so. Until today. I...
Popular posts from PHPDeveloper.org for the past week:Johannes Schmitt's Blog: A New Killer Feature for Symfony2 Security
XpertDeveloper.com: Abstract in PHP
Community News: ZendCon 2011 Wrap-ups (from a Speaker & Zend)
DZone.com: Closure Object Binding in PHP 5.4
Developer Drive: Create Your Own CRUD App with MySQL and PHP
PHPBuilder.com: An Early Look at Zend Framework 2.0
ArsMagnaTutorials: FuelPHP Tutorial Videos
Ibuildings techPortal: Architecture Patterns: Domain Model and Friends
A couple of weeks ago a friend of mine asked me how to use MySQL stored procedures with PHP's mysqli API. Out of curiosity I asked another friend, a team lead, how things where going with their PHP MySQL project, for which they had planned to have most of their business logic in stored procedures. I got an email in reply stating something along the lines: "Our developers found that mysqli does not support stored procedures correctly. We use PDO.". Well, the existing documentation from PHP 5.0 times is...
On Reddit.com there's a recent post that asks the question How do YOU sanitize input in your PHP applications?I am developing some software for my high school using HTML, CSS, MySQL, and most importantly PHP. [...] So I pose this question, what is YOUR favorite way to sanitize input for inserting, updating, or selecting from a database? Also, is there any way you prefer to verify that input is of a certain type, and only of that type ie, if you're expecting an int or a string, how would you make sure you...
The Seattle PHP User Group is having this month's meeting tonight (the 3rd) starting at 6:30pm at Market Leader, Inc featuring talka from Brian Swan on "PHP on Azure" and Jesse Keating on "Git".Market Leader,Inc. is graciously hosting the venue for Seattle PHP Meetup in Kirkland, WA this month!! In fact, Ariz Jacinto (long-time member & frequent presenter at our Meetups), an employee of Market Leader, Inc., has gone bonkers and lined up a killer night for us all! Note the entrance and then celebrate the...
I'm happy and proud to announce that I will be speaking at the D-Day conference in Finland. I will be doing my "Don't use a screw when you need a nail" talk there, a talk I've done before at Symfony Live in San Francisco and Paris and highly enjoyed doing.
On NetTuts.com today there's a new tutorial helping you get started with Zend Framework "from scratch". They outline the full process - from download to the creation of a first application.Ready to take your PHP skills to the next level? In this new "From Scratch" series, we'll focus exclusively on Zend Framework, a full-stack PHP framework created by Zend Technologies. First in our tutorial series, is "Getting Started with Zend Framework."The tutorial (executed in a Windows environment) is broken up...
Here's what was popular in the PHP community one year ago today:Site News: Popular Posts for the Week of 11.05.2010
Juhana Rasanen's Blog: Using MongoDB with CodeIgniter
Mashable: 10 Intermediate and Advanced Tips from PHP Masters
Community News: PHP-Dev Mailing List - PHP 5.4 alpha
Ahmed Shreef's Blog: Soap Web Services in PHP & hint on consuming from .Net
Jose da Silva's Blog: Revisiting PHP 5.3 __invoke magic method
DZone.com: From Doctrine 1 to Doctrine 2
Project: PHPScenario - A Free Split Testing...
Latest PHP Tweets