PHP forums, MySQL forums, Web Development resources

Home PageHome    PHP ResourcesTopic List    FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups 
 RegisterRegister
    ProfileProfile    Log in to check your private messagesLog in to check your private messages    Download the RSS Reader RSS Feed Download the RSS Reader RSS for this forum Log inLog in 

PHP Forum :: MySQL Forum :: Java Script Forum



MySQL query OK in localhost, error on ISP serve.

 
Post new topic   Reply to topic    WeberForums.com Forum Index -> MySQL General
View previous topic :: View next topic  
Author Message
contiw



Joined: 25 Mar 2008
Posts: 3

PostPosted: Thu Apr 17, 2008 6:48 am    Post subject: MySQL query OK in localhost, error on ISP serve. Reply with quote

The following query run flawlessly in localhost but produces error on ISP server:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct sf_threads.views) as views, ((count(distinct sf_messages.' at line 6

The actual behaviour here:
http://eduforums.us or
http://wconti.com/schoolsforums/index.cfm

I am using the exact same database both in local and server.
Running MySQL 5 in localhost and supposedly versions 4 and 5 sopported by the ISP server.

Thanks for helping

------------

SELECT
conferences.id,
conferences.name,
count(distinct forums.id)-1 as schools,
count(distinct threads.id) as topics,
count(distinct messages.id) as msgs,
sum(distinct threads.views) as views,
((count(distinct messages.id) *2) +sum(distinct threads.views) ) as activity,
0 as hBarLength
FROM ((conferences
left JOIN forums ON conferences.id = forums.conferenceidfk)
left JOIN threads ONforums.id = threads.forumidfk and threads.author <> 'admin')
left JOIN messages ON threads.id = messages.threadidfk and messages.author <> 'admin'
GROUP BY conferences.id
Back to top
View user's profile Send private message
lostboy



Joined: 02 May 2004
Posts: 5572
Location: toronto, canada

PostPosted: Sun Apr 20, 2008 3:15 pm    Post subject: Reply with quote

try running the query thru phpmyadmin or some other gui to see what the error is
_________________
Lostboy

Cat, the other other white meat

Please read Posting Etiquette before posting

You can always try Google
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Display posts from previous:   
WeberTrivia Questions WeberTrivia Questions
 Think you are smart? Prove it!. Try your skills with these questions :
 WeberTrivia QuestionsRecursive arrays and multi-dimensional arrays are one and the same. (PHP and MySQL)
 WeberTrivia QuestionsThe \"cache_dir\" tag of the squid configuration has a default of /var/spool/squid. (Linux)

WeberTrivia Questions



Post new topic   Reply to topic    WeberForums.com Forum Index -> MySQL General All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum






Powered by phpBB © 2001, 2005 phpBB Group
PHP Forum :: MySQL Forum :: Java Script Forum