|
Posted by drako on 01/18/07 16:31
You are correct in assuming that I chopped out a line when I posted
this...
The missing line between '$x=0' and
'$_SESSION["increment"][$x]=array(...)'.
is
if(isset($_SESSION["increments"])) {$x =
count($_SESSION["increments"]);}
The purpose is to count the number of entries in the array - if count
returns '5', then the last value of $x would have been 4, so we can
assign '5' as the next value in the array.
Could this be the offending line...
Toby Inkster wrote:
> drako wrote:
>
> > I'm sure that there is a pretty simple mistake lurking somewhere - I
> > just can't seem to figure it out.
> >
> > Any suggestions or hints ?
>
> There doesn't seem to be anything wrong with the code you posted (except
> for a missing semicolon after $x = 0), so I suspect the problem lies
> somewhere in your other code.
>
> Because of this missing semicolon, I suspect you have chopped out a
> section of code between '$x=0' and '$_SESSION["increment"][$x]=array(...)'.
> That is almost certainly where your problem lies. In particular, I think
> you may have assigned some non-integer value to $x at some point.
>
> Do 'print_r($x);' just before the error happens and see what you see.
>
> --
> Toby A Inkster BSc (Hons) ARCS
> Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|