1. I understand the first bit and have substituted the actual key names. I was trying to be clever - always a mistake! I had not fully understood the difference between the two types of array. The query now runs, but I do not get the expected result. I get "Resource id #8" instead of the expected integer, (4) in this case.
2. I am vaguely aware of SQL injection, bit do not think (??) it matters in this case as the site is private with only two users.
3. This bit I do not understand, but will do some research to hopefully educate myself.