revjim.net

October 29th, 2002:

mysql_fetch_allrows()

For Brad.

Here is a PHP function that will grab all the rows from a mysql result identifier:

function mysql_fetch_allrows($res) {

	while($data[] = mysql_fetch_assoc($res)) {
		# nothing
	}

	return array_slice($data,0,-1);

}

Or, if you just want one field:

function mysql_fetch_field_allrows($res,$field) {

	while($data = mysql_fetch_assoc($res)) {
		$rtn[] = $data[$field];
	}

	return $rtn;

}

mod_rewrite tutorial

Webmasterbase.com has an excellent article on Apache’s mod_rewrite. If you are developing any kind of web application (blog tools, photo gallery, forum software, a guestbook script, ANYTHING), and either don’t know how to use the “PATH_INFO” environment variable or just don’t like messing with it, then mod_rewrite is for you. If you’ve ever migrated a portion of your website from one tool to another, and wished there was a way you could do so without generating 404s for anyone who has linked to you, or bookmarked you prior to your migration, then you too can get a lot of use out of mod_rewrite. [via Keith Devens]

morning quickies

Keith Devens will soon be releasing version 3 of his XML-RPC Client/Server for PHP. His new version, due for release this week or next, promises to be the best available. It will allow (hopefully) client and server creation in one line of code. It uses native PHP variable types and will most likely support SSL.

Clark Hornbell hates baseball as much as I do.

The blogchannel:changes RSS element is an interesting new addition. When I began writing my RSS aggregator, I had wanted something like this. Weblogs.com additional support to show changes to an RSS feed is also a good idea. I prefer Blo.gs implementation of this, as, in most cases, the RSS feed and the weblog itself change at the same time. Additionally, the problem with the weblogs.com implementation is that you can’t define a list of feeds you are interested in. So, in order to see the changes, you have to download all the changes. This isn’t a big deal now, but wait until more people start using it and it will be.

In case I wasn’t clear about this yesterday, cashets.com is a serious waste of time. The fact that Michael Phillips is calling it “the first successful online micro-payments system” [1] is a bit absurd, since I would hardly consider this a success. I signed up for my account, and was user number 116. I managed to steal items that were being sold using this technology. I also managed to make money without ever having had a payment due to abuse of the system. I think it’s getting a little more exposure than it deserves or expected, because it has been showing ASP errors all morning.

LogJam v4.0.0 has been released. LogJam is still the best blogging client I have ever used for any platform. Unfortunately it only supports LiveJournal. If you use LiveJournal, check it out. If you’re writing a client side blogging application, download it so you’ll know how a blogging client should feel.

Brad didn’t get canned. Hang in there, buddy.


[1] http://www.well.com/~mp/host.html: Scroll down to the last item under the “Finance” heading.