Actually this ended up doing what I needed:

                                                           $result = 
mysql_query($sql) or die(mysql_error());                                        
                   $header = false;                                             
                 while($row = mysql_fetch_assoc($result)){                      
                                           echo ($row['name']),'<br>';          
            $header = true;                                                     
echo ($row['inDate']),'<br>';                                                   
              echo ($row['inType']),'<br>';                                     
                            echo ($row['notes']),'<br>';                        
                                         echo ($row['critical']),'<br>' ;       
           }                                                                }

On 7/16/09 2:53 PM, "Kyle Smith" <> wrote:

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 />';


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to