Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
GeXus
Forum Regular
Posts: 631 Joined: Sat Mar 11, 2006 8:59 am
Post
by GeXus » Sat May 13, 2006 1:44 pm
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!
raghavan20
DevNet Resident
Posts: 1451 Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:
Post
by raghavan20 » Sat May 13, 2006 1:50 pm
what is the error you get?
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Sat May 13, 2006 1:54 pm
'unique' is a reserved word in MySQL. change your alias to something else.....
raghavan20
DevNet Resident
Posts: 1451 Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:
Post
by raghavan20 » Sat May 13, 2006 2:16 pm
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
GeXus
Forum Regular
Posts: 631 Joined: Sat Mar 11, 2006 8:59 am
Post
by GeXus » Sat May 13, 2006 4:20 pm
Excellent, thank you!