EchoFool Posted February 2, 2008 Share Posted February 2, 2008 I have never had this error before and no idea what to do to fix it... this is my query: $GetConversation = mysql_query("select distinct(contact1,contact2,contact3) as touch from ((select distinct(messages.receiver) as contact1 from messages where messages.sender = 3 or messages.receiver = 3) as foo, (select distinct(textmessages.receiver) as contact2 from textmessages where textmessages.sender = 3 or textmessages.receiver = 3) as bar, (select distinct(phonecalls.receiver) as contact3 from phonecalls where phonecalls.sender = 3 or phonecalls.receiver = 3) as bat) WHERE phonecalls.receiver='$ID' or phonecalls.sender='$ID' or textmessages.receiver='$ID' or textmessages.sender='$ID' or messages.receiver='$ID' or messages.sender='$ID'") or die(mysql_error()); If you need to know what it's meant to do then ill type it for ya, if its just a syntax thing where have i gone wrong? Quote Link to comment Share on other sites More sharing options...
toplay Posted February 2, 2008 Share Posted February 2, 2008 When using DISTINCT, you can only specify one column. So, you have to fix this: distinct(contact1,contact2,contact3) http://dev.mysql.com/doc/refman/5.0/en/select.html Quote Link to comment Share on other sites More sharing options...
EchoFool Posted February 2, 2008 Author Share Posted February 2, 2008 When using DISTINCT, you can only specify one column. So, you have to fix this: distinct(contact1,contact2,contact3) http://dev.mysql.com/doc/refman/5.0/en/select.html Is distinct the best thing to use for this? In your opinion ? Or should i try some other method? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.