PHP Posts

MySQL

Looping through Mysql Columns

Andy Stramer • October 5, 2009

Recently I was looking into a way to echo out each column name of a mysql database. Of course I needed to do it dynamically as the database could change and the application is in PHP….

Read More

PHP

Growl from PHP

Tim Barsness • July 29, 2009

I just found this nifty PHP class for sending growl notifications from sitecrafting.com.  Very nifty.  Here’s some sample code to get it going: // Setup $growl = new Growl(); $growl->setAddress(’127.0.0.1’); $growl->addNotification("Test"); $growl->register();   // Send Notification…

Read More

PHP

Generate Random Strings in PHP

Tim Barsness • May 11, 2009

I needed to generate some random strings today for password resets.  Here’s what I used: function genRandomString($length = 10) { $characters = ‘0123456789abcdefghijklmnopqrstuvwxyz’; $string = ”;   for ($p = 0; $p < $length; $p++) {…

Read More