I think that the here doc is a good solution in this case. If not, then I can think of absolutely no situation where it would be a good solution. You avoid quoting issues (both ' and " are valid quotes in sql, so why restict yourself to just one because you chose to open your string with one or the other?) and save yourself a headache when trying to debug.