Archive for June 22nd, 2006

Limitless Studios: Determine Number Of Online Users Without A Database

From the Limitless Studios website, there’s a new tutorial for those frustrated by the other “who’s online” tutorials that require a database. Their example doesn’t, opting instead to handle the process with PHP’s sessions.

Most web developers will usually like to determine the number of online users currently browsing their web site. Most tutorials will teach you how to do just that using a database of some sort because it is easy to implant. Using a database though can be a bit slow at times, especially if your web site gets a lot of hits. In this tutorial, we will teach you an alternative and effective way to determine the number of online users WITHOUT using a database.

They note the overhead that using a database can cause, and look instead to something PHP works with natively - sessions. Their code is contained inside of a function, checking the session path PHP uses for session files that haven’t expired yet.

Continue Reading · Add comment

Dublish.com: Simple Optimization for PHP and MySQL

Dublish.com has this post from a little while back with some good tips on how to squeeze the most out of your MySQL and PHP scripts with some simple, handy tips.

The MySQL list includes things like:

  • MySQL is interpreted from right to left so you should put the most significant limiters as far to the right as possible.
  • Use indexes on the columns in the WHERE clause and on the columns you want to ORDER BY.
  • Sometimes mysql_free_result() end up wasting more memory than it saves. Check the difference with memory_get_usage().
  • Use NOT NULL as default value as much as you can, it speeds up execution and saves one bit.

And the PHP list includes:

  • When echoing strings it’s faster to separate them by comma instead of dot.
  • Unset your variables to free memory, especially large arrays.
  • Many code blocks might slow down the interpretation a little bit.

There’s also all sorts of other tips down in the comments as well.

Continue Reading · Add comment

Zend Developer Zone: Accessing DB2 Data Inside of i5/OS

On the Zend Developer Zone today, there’s this quick look at a post from the Zend Forums about grabbing DB2 data from inside of i5/OS.

Every now and then you find a gem stuffed way back in the back of the forums. I came across this one and since it solves a problem that I’ve seen asked more than once I thought I’d post it here for all to see. This was original posted by Mike Smith of IBM. Many thanks to Mike for this informative post.

For those of you who read the entire thread, I do have confirmation from IBM that the problem pointed out near the bottom of the thread is fixed in the latest beta.

The reminder of the post gives the functions and two code examples to help you pull the information (in this case names and catalog information) from the DB2 instance.

Continue Reading · Add comment

IBM developerWorks: Craft a Webmail interface for PHP applications

In this new tutorial from the IBM developerWorks site, they take a look at the development of a webmail interface with the help of PHP.

You know how to get users to interact with a PHP application using a Web form, but sometimes e-mail is just more convenient. Maybe your users are using small devices like cell phones or interacting in a way that’s not real time, such as subscribing to an e-mail list. Find out how to read and send e-mail by building a PHP Webmail application.

They cover connecting to the server, grabbing the information from a specific email inbox, pulling the data for a single message, deleting emails, getting a list of the current emails, and how to work with attachments and multipart MIME messages.

You’ll need to log in to get to it, but it’s a great example of how to work with email in PHP (more than just sending them with mail() or PEAR’s mailer package).

Continue Reading · Add comment

Disaster Prevention and Recovery with the MySQL Database

If you need to administer MySQL this article gets you off to a good start. In this section we discuss the issues of disaster prevention and recovery. The fifth of a multi-part series it is excerpted from chapter four of the book em MySQL Administrator s Guide em written by Paul Dubois Sams ISBN 672326345 ….

(Advertisement) Protect your software for the entire lifecycle. Only Unified Software Protection from SafeNet gives you complete security from the development stage through fast and flexible licensing, to distribution and beyond. Lock down your software– click for a free whitepaper on securing software revenue.

Continue Reading · Add comment