Thread: php While logic
View Single Post
  #3 (permalink)  
Old Feb 1st, 2007, 11:32
masonbarge's Avatar
masonbarge masonbarge is offline
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: php While logic

Quote:
Originally Posted by dcarson View Post
can you help me fix this php code?
foreach ($Count as $curNum)
echo "<p>$CurNum</p>";
$CurNum is not initialized.
This is the danger with using cute inner caps, or any caps, with php variables. I suggest you use all lowercase for all variables. If you want to use javascript style for functions, that's another matter.

#2 What is this trying to do? You have a foreach loop inside a while loop (or following a while loops, it's impossible to parse) with incorrect syntax. Furthermore, $Count is not an array.

You need to study up on some very basic php principles before you start coding.

Last edited by JacobHaug; Feb 7th, 2007 at 18:46.
Reply With Quote