I'm trying to build a query for a calendar program for a web site.  
Basically, I want a query that will print a word if there is an event booked 
on that day.

Here's how the relevant tables are laid out and what they mean:

TABLE: activities
AID - Primary Key
ALocation
AEmail
AName
ADay
AMonth
AYear
ACost
ATime

TABLE: clientactivities
CAID - Primary key
CUserName
AID - Foreign key from activities

Basically, activities lists all the activities announced by members.  Client 
activities shows all the events that a person has signed up for.

How can I build a query that will accommodate both tables.  Currently, i've 
got:
SELECT * FROM activities WHERE (activities.CUserName='$CUserName' AND 
ADay='$d' AND AMonth='$themonth' AND AYear='$y') OR activities.AID = 
clientactivity.AID)

But it doesn't quite work.

Thanks,
Mike
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to