[SOLVED] Silly parse error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kzar
Forum Newbie
Posts: 16
Joined: Thu Nov 25, 2004 3:03 pm

[SOLVED] Silly parse error

Post by kzar »

I have been staring at this for a while now and just can't see the problem. This is the line thats causing problems.

Code: Select all

if ( ($Slot[$k][DayID] == Day[$i]) && ($Slot[$k][TimeID] == Time[$j]) )
The error I'm getting is "Unexpected [" but I can't see the problem
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

Day[$i]

should be
$Day[$i]



you did that twice


also, you should use quotes around your litteral array indices.

$Slot[$k][DayID]

should be

$Slot[$k]['DayID']
kzar
Forum Newbie
Posts: 16
Joined: Thu Nov 25, 2004 3:03 pm

Post by kzar »

thanks, i knew it would be somthing dumb
Post Reply