Re: Newbie - Spot the error
| From: | Olav Bringedal | Date: | Wed, 15 May 2002 11:00:18 +0000 |
| Subject: | Re: Newbie - Spot the error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-97691@lists.php.net to get a copy of this message | ||
--- Josh Edwards <josho@tpg.com.au> wrote: > if I
have $time = 21 then
>
> $timespread
>
=array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
> if ($time = = "21")
> $timespread[22]=($timespread[22]+1);
> echo $timespread[22] ;
>
> I get 0
>
It might be "= =" which should be "==". If not, try:
$timespread =array
(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
if ($time == "21")
{
echo "before:".$timespread[22]."<b>" ;
$timespread[22]=($timespread[22]+1);
echo "after:".$timespread[22]."<b>" ;
}
else
{
echo "time is not 21" ;
}
Then you can at least establish where things go wrong.
=====
Olav Bringedal
jaggu.org
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com