Quantcast

Tag Archives: php

Using Cursors with PHP MySQLi and Multiple Prepared Statements

After my post on using PHP MySQLi and multiple prepared statements at the same time someone commented that using cursors could do the same thing. With that comment I dug some more and found that modifying the cursor type that is used under the covers will indeed let you execute multiple prepared statements concurrently on [...]
Posted in programming | Also tagged , , | Leave a comment

Building HipHop PHP for Fedora 12 on 64 bit and 32 bit Systems

Now that Facebook has finally released the source for HipHop PHP it is time to give it a spin. Of course it is still a little rough around the edges so I figured I would toss together a quick howto on getting it to build. The first thing to note is that they are only [...]
Posted in programming | Also tagged , , | 7 Comments

PHP MySQLi and Multiple Prepared Statements

While sprucing up the PHP code I use to provide my own Stack Overflow API for GeeQe I ran into an error caused by trying to use multiple prepared statements with MySQLi. It turned up when I tried to execute one prepared statement while looping over the result set from another prepared statement that were [...]
Posted in programming | Also tagged , | 4 Comments

Full Text Search with Sphinx

While developing my GeeQE iPhone application I decided I needed a way to let users search posts so I started looking around for a simple search engine that I could use with PHP. I took a look at a number of different options like MySQL Full Text search, Sphinx, Solr and others based on Lucene. [...]
Posted in programming | Also tagged , | 3 Comments

Anonymous functions in PHP

I ran into this and found it interesting. Someone has added support for anonymous functions in PHP. With the patch you can now do stuff like: $data = array("zoo", "orange", "car", "lemon", "apple"); usort($data, function($a, $b) { return strcmp($a, $b); }); var_dump($data); # data is sorted alphabetically Before you had to use a funky function [...]
Posted in programming | Tagged | 3 Comments

Upgrade to PHP 5.2 and Get JSON For Free

A few days ago when PHP 5.2 was released one of the things that caught my eye was that it now includes the JSON extension. For anyone doing AJAXy type stuff JSON is an easy way to martial your data between your server side language and javascript. For the longest time I've been using the [...]
Posted in programming | Also tagged , | Leave a comment

Creating S3 URLs that expire using PHP

After reading this post on the S3 forum I realized that other people are thinking about doing some of the same stuff I have. paolonew was looking for a way to for a way to create URLs to S3 objects that expired. I did this a while back when I was thinking about how to [...]
Posted in programming | Also tagged | Leave a comment