0

i need to know if there is a member whose enrollment date is earlier than a specified date.

If this case, the specified date = $Monday

$Monday = 12-30-2009;
$result = mysql_query("SELECT COUNT(*) FROM agents WHERE (sponsor = '$parent') and  (lft between $leftlft AND $leftrgt) and (enrollment_date >= '$Monday')");

I tested to put a member with enrollment_date as 12-3-2009 but the this results to 0.

So tried to reset the $Monday to 12-29-2009 and returned 1 result.

What do you think is the problem with this code?

Edited by codewalkz: n/a

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by codewalkz
0

try it this way:

$Monday = 12-30-2009;
$result = mysql_query("SELECT COUNT(*) FROM agents WHERE (sponsor = '$parent') and  (lft between $leftlft AND $leftrgt) and (enrollment_date >= ".$monday);

Well, I just fixed the $monday part. I just noticedthat you have a bunch of vars in there. You have to concatenate the variables to the string segments. like

" query stuff".$myvar."more_query string".$another."last part of query in quotes as well";

Edited by JRM: n/a

0

That was awesome. What does "." do? Im a newbie. Thanks a lot bro!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.