You can't use tags in PHP code, as the PHP code will be interpreted as PHP code first, not part of the template. You should do the logic in your controller or model and pass whatever you're getting from the DB in the $eods variable to the template.
Also,
<?php echo $this->db->get_where('mit', array('id' => $thing)); ?>
will get a MySQL (probably) result, not a single value. You will at least need to do something like:
$var = $this->db->get_where('mit', array('id' => $thing))->row()->thing;
but that will throw an error if no rows are found. A MySQL join might be better.
Good luck.