Page 1 of 1

for or while loop

Posted: Sun Nov 01, 2009 10:16 pm
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 
            {
                         ................
                         ................
                 }
        }
    }