Archive for February, 2006

MySQL strict mode problems

Simon Collison does such a good sales patter for ExpressionEngine in Blog Design Solutions that I decided to try it out. Things looked even brighter than his description when I disovered that not only has the price for the non-commercial licence has gone down from $149 to $99, but there’s now also a “Core” version, which is a free, unlimited trial. The free version lacks a lot of features, but it’s a good way to give ExpressionEngine a test drive without needing to worry about how many days you’ve got left to make up your mind whether to buy the paid-for version.

My enthusiasm took a sharp turn for the worse when the installation process failed at the last fence. I kept on getting the following message:

Error: Unable to perform the SQL queries needed to install this program. Please make sure your MySQL account has the proper GRANT privileges: CREATE, DROP, ALTER, INSERT, and DELETE.

I knew, however, that my account had all those privileges - and more.Eventually, I dug into the code of the installation file, search for the error message, and did a little debugging to find out what lay behind this unexplained failure. I got the page to display the problem SQL query, and then ran it directly in MySQL Monitor. All became clear: the primary key of each table is set to auto_increment, and the ExpressionEngine installation script attempts to insert an empty string into the primary key field. In older versions of MySQL, this works just fine, as the empty string is replaced by the next available number. In MySQL 5.0 running in SQL Strict Mode, though, this represents an out-of-range number, so the whole process comes to a grinding halt.

The solution was simple: switch off SQL Strict Mode in MySQL. Although it didn’t take me all that long to work this out, I suspect it’s going to catch out a lot of MySQL beginners. SQL Strict Mode is now turned on by default in the Windows Essentials version of MySQL 5.0, and ExpressionEngine isn’t the only mainstream script to use an empty string for the primary key in INSERT commands. It’s also used by phpMyAdmin.

So, for the time being, Windows Essentials users of MySQL should deselect the SQL Strict Mode option in the MySQL Configuration Wizard. A better solution, though, would be for everyone to start writing SQL commands that adhere to Strict Mode.

11 comments February 26th, 2006

Blog Design Solutions finally arrives

My author’s copies of Blog Design Solutions finally arrived this morning, and very nice it looks, too. I wrote only one chapter, so I’m looking forward to what my fellow partners in crime have to say about the world of blogging. I must admit that when I was first asked to contribute the chapter on setting up a local PHP and Perl testing environment, I wondered what the rest of the book would contain.

Well, now I know. I feel quite honoured to be with such a celebrated galaxy of web illuminati. My chapter follows a nice round-up of the blog scene by Phil Sherry. Then Andy Budd introduces Movable Type, Simon Collison waxes lyrical about ExpressionEngine, Chris J Davis and Michael Heilemann deconstruct WordPress, and John Oxton shows you how to get to grips with TextPattern. As if all that weren’t enough Richard Rutter has contributed a step-by-step tutorial on how to build your own blog tool from scratch with PHP and MySQL.

Although I’ve developed database-driven sites for several years, I’ve never bothered with a blog of my own, and the hype has always been that blogs are so easy to set up, a child could do it. Surely there couldn’t be enough to fill a whole book? How wrong I was.

Since I knew there was going to be a chapter on WordPress, I decided that was what I would use as the basis for the screenshots in my section. The Famous 5-minute Install really lived up to its name. Creating the database and setting everything up was ridiculously simple. Nor did it take me very long to work out how to change the design by downloading and installing one of the themes. How simple does it get?

I needed to get my chapter written, and then it was back to the grindstone finishing Foundation PHP for Dreamweaver 8. Once that was out of the door, I was rushed off my feet again with Foundation ActionScript for Flash 8. Consequently, I set the blog aside for several months.

When I finally got round to creating this site, I quickly realized that the 5-minute install is only the beginning of the story. Of course, if you’re happy with one of the pre-packaged themes, you can just get on with the blather. But if you want to incorporate something like WordPress into a website and making it look an integral part, there’s a huge amount of work to be done, and for me, that’s just as much fun as the blogging.

I’ve already dipped into the WordPress chapter, and only wished it had been to hand before I started digging into the all the code. The beauty of WordPress is that it’s highly configurable. But you need a good knowledge of CSS, as well as feeling comfortable crawling around inside PHP code. Fortunately, you don’t need a degree in computer science to do it, and I certainly found out more about WordPress from skimming through their chapter than I did from trying to read the online documentation.

Call me old-fashioned, but I still find it easier to read a book that I can hold in my own two hands than to absorb the same information from a website. Maybe that’s why I ended up writing books…

Add comment February 23rd, 2006

Dreamweaver 8 book goes to second printing

Great news from friends of ED. A second printing of Foundation PHP for Dreamweaver 8 has been ordered just two months after the book was first released. It’s great to know the book is doing well, but I’m also delighted they’ve agreed to replace the installation instructions for phpMyAdmin. I was caught in one of those dreadful situations when changes to a key open source application changed just as the book was due to hit the bookstores. It affected only two pages in a 500-page book, but what really hurt was the fact that the change took place exactly one day before the book left the printers.

Reaction to Foundation PHP for Dreamweaver 8 has been very encouraging so far. Let’s hope it sells well enough to run into many more printings!

6 comments February 19th, 2006


Calendar

February 2006
M T W T F S S
    Mar »
 12345
6789101112
13141516171819
20212223242526
2728  

Posts by Month

Posts by Category