A better Way? Or make this work?
Posted: Sun Jun 08, 2008 10:41 pm
Ok, I am trying to get an option to work with an existing db that has information in one table called campers, in that there are weeks, and each week is given a value based on how they are attending. I know this is not the best way to go about doing this but it is all I come up with without a lot of re-doing.
The problem is it don't work!
The WHERE reg_year='".$reg_year."' is not doing anything and I am getting campers from the past 5 years.
Help...
The problem is it don't work!
The WHERE reg_year='".$reg_year."' is not doing anything and I am getting campers from the past 5 years.
Help...
Code: Select all
$result = mysql_query("SELECT *
FROM campers
WHERE reg_year='".$reg_year."'
AND ".$_POST["week"]."='1'
OR (".$_POST["week"]."='4')
OR (".$_POST["week"]."='2')
OR (".$_POST["week"]."='5')
ORDER BY first_name, last_name ASC");
while ($mysql = mysql_fetch_array($result))
{