I assume that 2count should really be count and 2 is just the line-number you added in this post...
tececo_stats.views is (probably) the name of a column and cannot be used as an alias. Change it to something else. change count(*) to count(tececo_stats.*) (I think that's what you want) And you probably need a group by-statement at the end: GROUP BY whatever_you_need_to_group_by It's really difficult to answer your questions without the table designs, the error message and what you expect this query to do. And, it's not slightly OT. It's totally OT. :-) Regards Joakim Andersson > -----Original Message----- > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 09, 2002 10:10 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Grr SQL syntax error silghtly OT > > > Sorry :} > > I get a SQL syntax error at line two of the query: > > $query = "select > 2count(*) as tececo_stats.views, meta_data.title > from > meta_data, tececo_stats > where > meta_data.id = tececo_stats.id"; > > I have stared at this 'till i felt dizzy. can someone tell me > what I am > doing wrong so that I can learn from it? > > Thanks in advance > > > -- > JJ Harrison > [EMAIL PROTECTED] > www.tececo.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php