Mimsy Were the Borogoves

Hacks: Articles about programming in Python, Perl, PHP, and whatever else I happen to feel like hacking at.

42 Astoundingly Useful Scripts and Automations for the Macintosh

Work faster and more reliably. Use Perl, Python, AppleScript, Swift, and Automator to automate the drudgery of computer use. Add actions to the services menu and the menu bar, and create drag-and-drop apps.

Use simple scripts and make your Macintosh play music, roll dice, and talk to you. Create ASCII art from your photos. There’s a script for all of that in 42 Astoundingly Useful Scripts and Automations for the Macintosh by Jerry Stratton.

MySQL for other applications

Jerry Stratton, April 29, 2005

On Tuesday I taught a two-and-a-half hour MySQL tutorial. I’ve placed the manual for that tutorial to the Neon Alley tutorials section. Like most of my tutorials, this document is released under the GNU Free Documentation License.

It is available in RTF (from Word), HTML, and PDF.

Here’s the justification in the introduction:

If you’re going to use MySQL to display information on the web or in another application, you will eventually--sooner rather than later--need to understand the structure of your database and how to construct SQL queries.

Two of the most common applications you’ll use with MySQL are PHP and Dreamweaver. PHP is a programming language, which means you need to understand PHP first. But as soon as you start using MySQL with PHP, you run into the mysql_query() function. PHP has pretty much no built-in MySQL functionality. You construct a MySQL query, give that to PHP, and PHP hands it, intact, to the MySQL server.

Dreamweaver will insulate you from MySQL queries for the first few minutes. But as soon as you start doing anything out of the ordinary, you’ll run up against the “advanced” section of your recordset window. That “SELECT .... FROM... WHERE” phrase in the advanced window is nearly a pure MySQL query.

The appendix also contains some guidance on setting up “record sets” in Dreamweaver, and a sample script that uses PHP, Python, or Perl to output tables from MySQL.

If you notice any errors, please let me know. I’m somewhat unsure about the indexing stuff, for example.

  1. <- Style Sheets 2
  2. SpamAssassin Rules ->