Welcome Guest, Not a member yet? Register   Sign In
display record outside of foreach
#1

Hi coders.


i have foreach to display record and it work well but my problem is i need to display record ex. (date) outside of foreach or outside of a table  and how?.

example.
PHP Code:
<table
   <
tr>
    <
th>Description</th>
    <
th>Barcode</th>
    <
th>From</th>
    <
th>Date</th>
   </
tr>

<?
php foreach($result as $row): ?>
                        
    <tr>
    <td><?php echo $row['Barcode']?></td>
    <td><?php echo $row['description']?></td>
    <td><?php echo $row['from']?></td>
    <td><?php echo $row['date']?></td>
    </tr>
<?php endforeach; ?>
</table> 

Thanks.
Reply
#2

Why not just use the result array like

PHP Code:
print_r($result); 
echo 
$result[0]['date'];
... 

Reply
#3

It would be helpful if you showed how you want it to look.
Reply
#4

Hi coders,


its works well, thank " Rufnex ". . .
Reply




Theme © iAndrew 2016 - Forum software by © MyBB