please post more code, ie where $name is set.

in the mean time try this, shouldnt help but might

foreach($empid as $pos => $val)
{
    echo "{$empid[$pos]} {$name[$pos]}<br>";
}

-- 

 Chris Lee
 [EMAIL PROTECTED]



""Tom Harris"" <[EMAIL PROTECTED]> wrote in message 
98tcfg$bn3$[EMAIL PROTECTED]">news:98tcfg$bn3$[EMAIL PROTECTED]...
Here's an interesting problem.

The following only prints the first letter of the name

for ($i=0; isset($empid[$i]); $i++) {

    echo "$empid[$i] $name[$i]<br>";

}

But if I change the variable $name to $employeename throughout the script it
displays fine.

$empid[] and $name[] are both assigned earlier in the script by pulling data
from a MySQL database.

Is $name a reserved word or something? Anyone know why just changing the
array's name fixes the problem?

Thanks,

-Tom



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to