[eluser]bretticus[/eluser]
Yeah, I've noticed this little issue too. I admit that I "just tried something" at the spur of the moment (there may be a more official way.) My solution: add a column alias in my query. You've done that but you might need to tell codeigniter to leave your statement alone by telling it not to insert backticks. You do that by inserting FALSE into the 2nd parameter of select.
->select('table.name AS thename', FALSE)
This is just a hunch, now for the real problem...
You can't use your $record variable that you pass in the way that you think because you are just getting the result for one record. Pass the $query variable instead.
Code:
<?php
$this->db->select('table.name AS thename');
$query = $this->db->get('mytable');
$data['query'] = $query;
//... call your view with $data param ...
?>
Code:
<?php if($query->num_rows() > 0) : foreach($query->result() as $row) : ?>
<td><?= anchor('mylink'.$row->id,$row->thename) ?></td>
<?php endforeach; ?>