In response to: Its a Total Fire Ban and I'm tense

Comment from: Michael Todd [Visitor]
Michael Todd

Big respect to you Adam and thank you for giving your unique perspective.
Is over 45 years I have speaking publicly about this and I am stepping up efforts now

01/01/20 @ 19:51

In response to: MySQL 101 - Replication

Comment from: Pan [Visitor]
Pan

Nice posts about MySQL, It helps me a lot

04/05/17 @ 15:51

In response to: MySQL 101 - Creating your first database

Comment from: Scott [Visitor]
Scott

Great tutorial, thank you for putting it together, its been really helpful!

How would I set this up if there were multiple authors or publishers to one book?

Thanks

27/09/15 @ 08:36

In response to: On badly behaved crawlers

Comment from: Steve [Visitor]
Steve

Just to mention that we are now 2014 and magpie still hasn’t improved. My advice: ban it from your site right away. I get about 3 - 5 hits a second from that piece of junk when they decide to index my site and I’m tired of paying for their incompetence.

01/12/14 @ 19:21

In response to: MySQL 101 - Sorting and Searching: ORDER BY, WHERE, GROUP BY

Comment from: [Member]
aj

Hi David,

The JOIN statement creates a complex statement that builds on previous components. If you look at the first join (between author and book) you now have effectively a meta-table that includes fields from both. The next join needs only to reference fields from the meta-table, which in this case includes fields from book as well as author.

This is no to say that you couldn’t restructure the query to match your supposition, however you’d need to think carefully about the direction (LEFT/RIGHT) of the join as I’m using LEFT JOIN knowing that it will always provide me with a result provided there is a valid author, regardless of if that author has a book or publisher. If I structured the query such that book was before the FROM then I would need a valid book to list an author.

Note that I’m using the term meta-table as a convenience. The underlying database doesn’t need to create a separate structure.

11/08/14 @ 16:47

In response to: MySQL 101 - Sorting and Searching: ORDER BY, WHERE, GROUP BY

Comment from: David [Visitor]
David

Hello,

in the previous episode to this, a SELECT query was made with 3 joins, namely:

SELECT `title`,
CONCAT_WS(’ ‘,`author`.`first_name`,`author`.`last_name`) AS `author`,
`publisher`.`name` AS `publisher`,
`format`.`name` as `format`,
`price`, `isbn` FROM `book`
JOIN `author` ON `book`.`author` = `author`.`id`
JOIN `publisher` ON `book`.`publisher` = `publisher`.`id`
JOIN `format` ON `book`.`format` = `format`.`id`;

As I understand it, the tables `author`, `publisher`, and `format` each have a separate link back to the book table. Is that correct? Now in this episode you have the query:

SELECT CONCAT_WS(’ ‘,`author`.`first_name`,`author`.`last_name`) AS `author`,
`book`.`title` FROM `author`
LEFT JOIN `book` ON `author`.`id` = `book`.`author`
LEFT JOIN `publisher` ON `publisher`.`id` = `book`.`publisher`
WHERE `publisher`.`name` = ‘Bantam’;

I can see in the first join that the `book` table is linked back to the `author` table. But the second join to `publisher` is a join to the `book` table. I the thought that with multiple joins all tables following JOIN statements had to link back to the initital table referred to in the FROM statement.

08/08/14 @ 10:09

In response to: In memory of Eileen Mary Donnison (nee Cain)

Comment from: Boel [Visitor]
Boel

Adam, what a lovely tribute to your mother. She sounds like someone I’d like to have met. My condolences.

Boel

07/05/14 @ 09:50

In response to: In memory of Eileen Mary Donnison (nee Cain)

Comment from: Sarah [Visitor]
Sarah

Thank you for sharing this, she was an amazing Gran and an inspiring woman.

05/05/14 @ 22:28

In response to: MySQL 101 - Retrieving data: SELECT and JOIN

Comment from: [Member]
aj

Thanks, Jose, I’ve updated the links.

26/02/14 @ 18:33

In response to: MySQL 101 - Retrieving data: SELECT and JOIN

Comment from: Jose [Visitor]
Jose

Hey,

Great guides for starters (like me) only comment so far is about the website. The link for your ‘last episode’ has an extra http// in it (so it doesn’t work unless you remove it). And on your last episode (creating the database) you don’t seem to have a hyperlink to the next episode - just text saying what will be covered. Thought I’d comment just so people who are looking for these in order will have an easier time (I googled for this page to find it when the hyperlink on the previous wasn’t working).

Thanks again!
Jose

11/02/14 @ 02:53

In response to: MySQL 101 - Referential Integrity

Comment from: SQL dev [Visitor]
SQL dev

I have rarely seen programming taking advantage of Referential Integrity constraint e.g. CASCADE on UPDATE. It’s immensely useful specially in large application where data is subject to change by multiple people. Here is another good example of referential integrity in MySQL http://javarevisited.blogspot.com.ar/2012/12/what-is-referential-integrity-in-database-sql-mysql-example-tutorial.html which explains cascading.

09/01/13 @ 14:30

In response to: On badly behaved crawlers

Comment from: Neil [Visitor]
Neil

Just an update…We applied the robots.txt fix and noticed a distinct drop in origin traffic and CPU usage.

Not all magpie-crawler connections have gone but most have. We will only block the IPs as the last resort but it may come to that if we can’t get rid of them all via robots.txt.

Seems magpie is (as stated above) simply overly aggressive.

10/09/12 @ 19:36

In response to: Dealing with pre-emptive grief

Comment from: [Member]
aj

Hi Eli,

Unfortunately I ended up having to make the decision, as I knew I would. One thing you learn when owning pets is that you will outlive them, and that more often than not you are going to have to make some hard decisions. What you have to remember is that you have to act in the best interests of your pet. It is not betrayal to end suffering, although the point at which you decide that quality of life has gone will be different for different people and different situations. In fact, I see it as a duty, a responsibility of ownership.

I hope that your situation is easy on both of you, but please, don’t shy away from the hard decision if and when it becomes necessary. You will have doubts, that is only human - but if you love your dog the way it comes across from your words you will know when it is time to act.

30/08/12 @ 11:17

In response to: Dealing with pre-emptive grief

Comment from: Eli [Visitor]  
Eli

I took my twelve yr old golden retriever for a checkup and although she had been put on a reduced calorie diet and lost some weight and her arthritis was starting she had some really good days. The shock was the blood test showed she has leukemia and will die in 30 to 60 days. She shows no signs except the blood counts, eats well, no stomach problems but has anemia which slows her down. I am hoping I will not have to make that choice unless she stops eating or drinking as I feel I would feel I am betraying the animal that loves me most and will do anythings to please me. I understand how you feel pray so that he goes before you have to make a choice and he does not suffer.

30/08/12 @ 09:21

In response to: On badly behaved crawlers

Comment from: Neil [Visitor]
Neil

Hi all

The magpie crawler is also causing us some nasty issues on several large sites. The main issue for us is in fact that they persist in crawling non-existent pages, one of which alone is causing us over 20,000 404s per day.

We are taking steps now to ban magpie from our servers.

Cheers
Neil

24/08/12 @ 17:51

In response to: MySQL 101 - Creating your first database

Comment from: [Member]
aj

You are mistaken on a few fronts here. Firstly there is no error in the syntax, and the syntax used is ‘best practice’ for MySQL. Secondly, there is no single quote, they are backticks. Lastly it is not recommended to leave these out, as you set yourself up for problems in the future.

As to captcha - I’ll look into that.

30/07/12 @ 11:54

In response to: MySQL 101 - Creating your first database

Comment from: vaz [Visitor]
vaz

Note - the syntax that you used is wrong

You have mentioned : CREATE DATABASE “bookshop’;

Firstly - one can use either small oor caps for the create database

Secondly - if you give a single quote it will throw a ERROR 1064

Therefore, the correct syntax is as follows

create database sonic;
(no quotes)

Best….
(also one comment on the website caoptcha code - there is some problem, it refreshes the some captcha multiple times and does not allow to post, until one reloads the page and gets a new captcha. Also your captcha is little strange characters and one cant figure out the letters)

29/07/12 @ 06:36

In response to: On badly behaved crawlers

Comment from: Dave [Visitor]  
Dave

They’re being a nuisance for me as well. Whole subnet blocked now, for all servers.

15/03/12 @ 21:00

In response to: How to Write Crappy Code

Comment from: JC [Visitor]
JC

Here are some more:
Don’t indent your code, or better yet, indent it randomly.
Put inexplicable white space in here and there to make the file longer.
Always leave out of date ‘to-do’ comments in place, and never change a comment when you change the code.
If you must comment your fixes, be sure to leave out any meaningful references like CR or QC numbers, eg “// change (jc)”
Finally - and it’s not really a coding issue, but it does make for a good laugh - tell your boss that everything’s fixed and he can tell his client to relax, then check in the wrong version of the file!

29/11/11 @ 20:15

In response to: MySQL 101 - Replication

Comment from: Seppo Jaakola [Visitor]
Seppo Jaakola

Thanks for the writeup!

Galera Replication is missing in your reference list. Galera provides synchronous multi-master clustering for MySQL/InnoDB. And it is true multi-master, you can write to any row at any cluster node - just like MySQL/Cluster but works on InnoDB. And fully open source, downloads here: http://www.codership.com/downloads/download-mysqlgalera/

02/11/11 @ 21:06