Home > Uncategorised > How Did I Miss That!

How Did I Miss That!

Just been looking at the PHP documentation for the mysql_query function. I couldn’t possibly imagine the number of times I’ve used that function, and the number of queries that I have written.

I’ve just discovered this little bit in the documentationThe query string should not end with a semicolon.Wow! I’ve always insisted that it is present! It certainly works if it is present!

Now I’m thinking ‘Why not?’. I mean, it’s part of the SQL language to put a semi-colon on the end, so why shouldn’t I do it when I execute a perfectly valid query from with PHP?

Categories: Uncategorised Tags: , ,
  1. Rich
    March 21st, 2006 at 17:12 | #1

    Javascript
    Probably for the same reason that Javascript handlers in HTML don’t want semicolons. Also suggests that you can’t have multiple statements.

  1. No trackbacks yet.