Check out this MySQL
Query and then I'll show you what I really want it to do...
mysql_query("
SELECT * FROM Drinks WHERE
email='$Email'
AND date='$Date_Today'
OR date='$Date_Yesterday'
OR date='$Date_TwoDaysAgo'
OR date='$Date_ThreeDaysAgo'
OR date='$Date_FourDaysAgo'
OR date='$Date_FiveDaysAgo'
OR date='$Date_SixDaysAgo'
OR date='$Date_SevenDaysAgo'");
The problem with it is that I want it to always match the email. In this case (for example) if the date equals $Date_SixDaysAgo
then it will be selected from the query even if $Email
doesn't equal the email column.
So, in short, I want the email to always equal the email column, and if the query pulls a date that equals $Daye_TwoDaysAgo
or $Date_ThreeDaysAgo
etc.. but doesn't equal the email then don't pull it.
I guess my query would look kind of like this, but I'm pretty sure it won't work..
mysql_query("
SELECT * FROM Drinks WHERE
email='$Email'
AND date='$Date_Today
|| $Date_Yesterday
|| $Date_TwoDaysAgo
|| $Date_ThreeDaysAgo
|| $Date_FourDaysAgo
|| $Date_FiveDaysAgo
|| $Date_SixDaysAgo
|| $Date_SevenDaysAgo'");