counter customizable free hit

Friday, April 28, 2006

MySQL Stored Procedure Programming (The Book) - 3

I have mentioned a couple of times about the upcoming release of MySQL Stored Procedure Programming by Guy Harrison and Steven Feuerstein. It was scheduled for release in March but the release date slipped a couple of times, I pre-ordered and the good news is that the book arrived this morning, so it's out now (in the UK at least).

It weighs in at 636 pages so while it's not the door stopper that's often related to computer books there is a lot of information in there especially given the relatively recent addition of stored procedures to MySQL. Jay Pipes and Michael Kruckenberg did a great job with their stored procedure chapters in Pro MySQL but given that it wasn't an exclusive development book it didn't go into detail about using stored procedures from other languages, this new book goes into great detail on the subject with dedicated chapters on using stored procedures with PHP, Perl, Python, Java and .Net.

Having only received the book today I haven't had much of a chance to read it but first impressions look good and as I said previously if it's half as good as Steven Feuerstein's Oracle related books it will be well worth the money.

Thursday, April 27, 2006

Opportunities

It's been well mentioned by myself that of late the time I have been able to devote to MySQL has become restricted. Part of this was due to me taking an exciting new job just before Christmas. When I took the decision to close MySQLDevelopment.com down this was in part due to the fact I was using Oracle rather than MySQL and my exposure to real world situations was limited.

However the day after I made the decision and announced it here my boss asked me to take over the running of a MySQL/PHP based website. The good news at least is that it means it might give me something to actually comment on with regard to the blog, even if it doesn't afford me the time to continue with the site.

But it's not just good news for me it's also good news for you out there too, the company I work for are looking to take on some new developers. We are looking ideally for people with PHP and Oracle experience but are willing to train good PHP people with limited or no Oracle experience, if you have MySQL skills that would also be a great bonus. The company is based in SW London (England) very close to both over ground rail and tube stations, the atmosphere is relaxed, friendly and informal.

I personally can't recommend it enough as a place to work and it would be great to hear from you if you are currently looking for a role in the London area and have the skills we are looking for.

You can use the following link to get some more formal details or you can contact me directly for a more informal chat about the role.

Click here to see more details of the role...

Wednesday, April 26, 2006

Fun with dates

In response to Kai Voigt's post about unxepected results from dates here is what is going wrong.

To add and subtract time using + and - you need to use the INTERVAL keyword either before or after the + or - like so..

mysql> select now() - interval 2 day;
+------------------------+
| now() - interval 2 day |
+------------------------+
| 2006-04-24 07:31:02 |
+------------------------+
1 row in set (0.00 sec)

In Kai's example it's valid to use - on it's own but that handles the date simply as an integer and subtracts the number specified. In small cases as in the example this can seem as if it's the seconds being subtracted but if for example you subtract 100 it simply reduces the number by that amount and not by 1 minute 40 seconds as it sould for a date type.

mysql> select now() - 100 day, now();
+----------------+---------------------+
| day | now() |
+----------------+---------------------+
| 20060426073122 | 2006-04-26 07:32:22 |
+----------------+---------------------+
1 row in set (0.00 sec)

You can see above the seconds portion of the first "date" is the same where it should be different if it were dealing with it as a time. You can also see that any date formating has been removed (suggesting something odd is going on).

The second problem is that while you might think that not including the interval would case a problem it becomes a valid SQL statement because it treats the DAY simply as a heading in the output. To change the heading of a column we can either use AS column_name or simply column_name after our column definiton, this can be seen like so..
mysql> select now() - 100 day, now();
+----------------+---------------------+
| day | now() |
+----------------+---------------------+
| 20060426073122 | 2006-04-26 07:32:22 |
+----------------+---------------------+
1 row in set (0.00 sec)

mysql> select now() - 100 as "anything you fancy", now();
+--------------------+---------------------+
| anything you fancy | now() |
+--------------------+---------------------+
| 20060426073738 | 2006-04-26 07:38:38 |
+--------------------+---------------------+
1 row in set (0.00 sec)

So to add and remove time from dates you need to make sure you use the interval. Something to watch out for when you get unexpected results is the column heading, that might give a clue that all is not right with your SQL.

Tuesday, April 25, 2006

MySQLDevelopment.com gets a stay of execution

When I posted a few weeks ago about the end of MySQLDevelopment.com it seems the timing was a little off. I was planning to close things down on 30th April simply as it was the end of a month, what I hadn't taken into account was that this would coincide with the MySQL user conference. I won't say too much at the moment but there are plans to use the content on another site which will have some involvment with MySQL themselves, however because of the user conference the people involved won't be able to transfer the content until after the 30th.

Our visitor numbers are still growing the figures for March were twice those of January so to avoid any distruption of service I won't be pulling the plug until I can make a seemless switch.

Friday, April 07, 2006

MySQLDevelopment Update.

I have had a great response from people with regards to the (possible) closure of MySQLDevelopment. It seems people want to keep the site alive in one format or another and I have had a lot of communication from MySQL themselves with regard to keeping the content alive.

First let me say sorry to all the people who did respond, as suggested in my last post I am really busy at the moment and it's difficult to find the time to reply in a timely fashion. I will be contacting you all individually this weekend.

Whatever happens it seems that while the site may change a little as from the 1st May MySQLDevelopment will still be available in some form. I'll keep you posted.