Q:

fatal error mysql queries codeigniter

Trying to build a menu in a view. Giving me fatal errors/undefined query functions. The database is connected to via the load->database() in the construct of the controller. Not that familiar with codeigniter db queries but I assumed regular mysqli would work fine. Here's the code:
<div class="at_mainMenu gradient02">
  <ul class="sf-menu" id="example">
  <?php
    $query = $this->db->query("SELECT * FROM menu WHERE priority=0");
    foreach ($query ->result_array() as $row) {
      echo "<li class='current'><a href='".$row['link']."'>".$row['text']."</a>";
      $id = $row['menuId'];
      $children = $this->db->query ("SELECT * FROM menu WHERE parentId=$id ORDER BY priority DESC");
        foreach ($children->result_array() as $row) {
          echo "<ul><li><a href='".$row['link']."'>".$row['text']."</a>";
            $id2 = $row['menuId'];
            $grandchildren = $this->db->query ("SELECT * FROM menu WHERE parentId=$id2 ORDER BY priority DESC");
            foreach ($grandchildren->result_array() as $row) {
              echo "<ul><li><a href='".$row['link']."'>".$row['text']."</a></li></ul>";
            }
          echo "</li></ul>"; 
        }
      echo "</li>";
    }
  ?>
  </ul>

A:

You can not query without specifying the columns. You may want to use * for all columns or col1, col2 
SELECT [column list] FROM [table_name]

