Re: Invalid Argument why?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Miller, Terion wrote:
Why is this an invalid argument?

 foreach(($row['inType']) as $inType){

echo $inType,'<br>';}

I am trying to output results from a data base that may have multiple
results for the same name....

So trying to use an array and foreach that is the right track ...right?


Looks like you meant to do something like this:

// Always better to be plural when you have an array.
$rows = whatever_your_rows_come_from();

foreach($rows as $row)
{
   $inType = $row['inType'];
   echo $inType . '<br />';
}


HTH,
Kyle

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux