Jacob,

> I'm sorry to bother the newsgroup with this, but I've been racking my
> brain on it for a few hours, and tried all the documentation, and
> realize it's a coding problem that will take someone about 3 seconds to
> figure out the error in.  I have this code:

=don't be sorry, these 'blind spots' are the strength of the group.

=check out the differences between =, the assignment operator; and == the logical 
comparision operator; and ===
the logical type and comparison operator. You've used the first in the IF, when you 
want the second!

=Regards,
=dn


> <?php
>
> $current_month = date (m);
> $current_year = date (Y);
>
>
> if("$current_month = 1")
>    {
>     $previous_month = 12;
>  $previous_year = $current_year - 1;
>    }
>
> else
>  {
>  $previous_month = $current_month - 1;
>  $previous_year = $current_year;
>  }
>  print("<ul>");
>  print("<li><a
> 
>href=\"inquiry_reports.php?search=search&new_year=$previous_year&new_month=$previous_month\">Previous
> Month</a>");
>  print("<li><a
> 
>href=\"inquiry_reports.php?search=search&new_year=$current_year&new_month=$current_month\">Current
> Month</a>");
>  print("</ul>");
>  ?>
>
> but for some reason, no matter what the month, the first if statement
> (if current_month = 1) is seen as true and executes...  any suggestions?
>
> Cheers
>
> Jake Walker
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to