[eluser]snowstar[/eluser]
Hi all,
Im wondering if some one can point me in the right direction, i've written an if statement which should only print out results if one varable matchs the other. How ever its displays all the information in the table
snippet from my controller
Code:
$data = array();
if($query = $this->mymodel_model->get_one_data())
{
$data['records'] = $query;
}
if($query = $this->mymodel_model->get_one_details())
{
$data['drecords'] = $query;
}
snippet from my View
Code:
<?php if(isset($drecords)) : foreach($drecords as $drow) : ?>
<?php
if ( $row->invnum = $drow->orderid ) {
?>
<tr>
<td><?php echo $drow->prodid; ?></td>
<td><?php echo $drow->name; ?></td>
<td><?php echo $drow->des; ?></td>
<td> <?php echo $drow->qty; ?></td>
<td> <?php echo $drow->price; ?></td>
</tr>
<?php } ?>
<?php endforeach; ?>
<?php else : ?>
<h2>No Records were found</h2>
<?php endif; ?>
Note: $row->invnum is in a for each loop above this and doesnt close till end of page.
Im attempting to only print details that $row->invnum match $drow->orderid, Im not sure where im going wrong
The whole page is a template which is repeated for each result (from parent for each)