3

I am trying with following query

SELECT COUNT(*) 
  FROM users` 
  WHERE email = 'xyz@xyz.com'

This is not giving me syntax error (notice not include ` character at the starting of table name). And always gives me count as 1, although record in not there in db.

I will get the error if i remove COUNT from the query.

Hope this is not a bug in mysql.

OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
jimy
  • 4,848
  • 3
  • 35
  • 52

1 Answers1

2

The backtick seems to be commenting out the rest of the line.

I can't say why but I have tested it (through phpMyAdmin) and that it the case.

Brendan Bullen
  • 11,607
  • 1
  • 31
  • 40