...

View Full Version : for or while loop



oneofthelion
11-02-2009, 04:17 AM
What is my error?...I need to send message[$x] to user[$w]...but is is not working



...
$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
{
................
................
}
}
}

GoodBanners.com
11-02-2009, 10:07 AM
what is your error message?

and what are the values of $w and $x ? is your $userCounter variable set? probably easier to debug if you post the whole code



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum