Archive for the ‘MySQL’ Category

Both sides of a quick and simple web service

Posted by michael on April 3rd, 2007 under Code, MySQL
 •  1 Comment

To clarify the article title, when I say web service, I mean a piece of software that will receive and send out data via the HTTP protocol. Furthermore, this data is usually transmitted in XML format. I will also call this XML RPC occasionally, but there is also a specification called XML-RPC so things can [...]

Executing shell commands

Posted by michael on March 6th, 2007 under MySQL
 •  No Comments

Just a quick post - if you’re using PHP’s shell_exec to execute shell commands, take note of the following:
Permissions
If you’re reading or writing files, ensure that your working directory has the correct permissions for the www/apache user to access what it needs. On some systems, PHP will run as the nobody user, so adjust accordingly.
Pipes
Using [...]

Sorting arrays by an arbitary key value in PHP

Posted by michael on February 27th, 2007 under Code, MySQL
 •  No Comments

I often (a couple times a month) have to sort an array of arrays by some arbitrary value located in the internal array. For example, I might want to sort the following structure by name.
Array[0] {
Array[0] {
id [...]

Useful things to know in CakePHP

Posted by michael on February 14th, 2007 under MySQL
 •  4 Comments

CakePHP is an awesome MVC (Model-View-Controller) framework for PHP 4 and 5 - it provides a great base to build your web application on, and can save you a huge amount of time if used correctly.
Unfortunately, the manual is sometimes lacking - whilst the information you need might be there, you probably will not be [...]

B2B: Testing and defining variables in PHP

Posted by michael on January 23rd, 2007 under Code, MySQL
 •  1 Comment

PHP is a dynamic, weakly-typed language, and as such, beginners to the language will often find their code acting unpredictably because of assumptions they have made.
PHP has a fairly low entry point for new programmers - it’s easy enough to get a couple of small sample scripts up and running, but on the same token, [...]