for or while loop

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
oneofthelions
Forum Newbie
Posts: 14
Joined: Tue Oct 27, 2009 2:41 am

for or while loop

Post by oneofthelions »

What is my error?...I need to send message[$x] to user[$w]...but is is not working

Code: Select all

 
...
$userArray['username'][$w]=$row['usernm'];  //getting users from user table
$messageArray['message'][$x]=$row['message'];          //getting messages from message table
...
for($i=0 ; $i<$userCounter ; $i++)                  //I checked the counter, it has correct no: of users
  {
    while ($w==$x)
        {
            $username=$userArray['username'][$w];
        $message=$messageArray['message'][$x];
        if(strlen($message)<1)
            {
             echo $error;
            } 
        else 
            {
                         ................
                         ................
                 }
        }
    }
 
 
 
Post Reply