Page 1 of 1

Is something wrong with this query

Posted: Sat May 13, 2006 1:44 pm
by GeXus
Could anyone tell me what is wrong with this query? Is the Syntax wrong?

Code: Select all

mysql_query("SELECT count(*) as Impressions, count(distinct IP) as Unique, Keyword as Keyword FROM `AdTracking` WHERE `PublisherID` = $PublisherID and DT >= $DateStart")or die(mysql_error());

Thanks!

Posted: Sat May 13, 2006 1:50 pm
by raghavan20
what is the error you get?

Posted: Sat May 13, 2006 1:54 pm
by Burrito
'unique' is a reserved word in MySQL. change your alias to something else.....

Posted: Sat May 13, 2006 2:16 pm
by raghavan20
Burrito wrote:'unique' is a reserved word in MySQL. change your alias to something else.....
I did not look at so keenly as burrito did, do not change alias but put backticks around it

Posted: Sat May 13, 2006 4:20 pm
by GeXus
Excellent, thank you!