LAMP

Formbuilder for data objects

I recently started working with DB_DataObject_FormBuilder, a part of the PEAR extensions to PHP. It is quite handy for rapidly creating web forms from MySQL databases. Unfortunately the main website with documentation is offline at the moment. Google has some of the pages in its cache.... digging.

phpMyAdmin

There is a new release of phpMyAdmin bringing the current version to 2.6.0. However I don't seem to be having success with the relationship features. It seems to choke on an empty column_info table because the SQL doesn't work as it expects the pma_column_info table to be complete.

Database Abstraction

Jeremy Zawodny has an article about the ills of database abstraction. At first when I read it I thought he was perhaps a bit loony. But the more I thought about it the more it makes sense. I'm thinking particularly of my current favorite database abstraction model for PHP - AdoDB. I've come to use it under what Jeremy calls the "Portability Fallacy".

Webmin glitch with apache

I just spent some time finding a bit of a glitch with WebMin and the Apache module. By default the PHP configuration portion of the httpd.conf file is configured to add index.php to the list of directory indices. If you try to override this setting in Webmin it never takes. You can add index.htm all day long but it simply won't add. A quick work around is to add index.htm to the various DirectoryIndex entries for the versions of PHP.

Selecting the most recent entry for a person in MySQL

Here's a snippet of code to get the most recent entry for a person from a list of records with dates. I use this in a situation where I have a list of GPAs for students. The list of GPAs is updated each day for a couple of weeks. The challenge is that some students graduate and are dropped from the list each day so I need to pick the most recent record for each person in the database.

SELECT name, gpa, standing, run_date
FROM `ranking` AS a
WHERE ( standing = '123' OR standing = '122' ) AND a.run_date = (
SELECT MAX( run_date )
FROM `ranking` AS b
WHERE b.name = a.name )
ORDER BY standing, gpa DESC

Pages

Subscribe to LAMP