title: database to pdf in code igniter
body: <p>i want to generate a pdf file in code igniter,
  i have used CI db utilities to get data from db in csv format</p>
  
  <p>my model is this..</p>
  
  <pre><code> function prr(){
          $id=$this-&gt;db-&gt;insert_id();
          $query = $this-&gt;db-&gt;query("SELECT * FROM bookings where did='1' &amp;&amp; email='jk@gmail.com' &amp;&amp; id='$id'");
          $result2=$this-&gt;dbutil-&gt;csv_from_result($query); 
          return $result2;
      }    
  </code></pre>
  
  <p>i am getting a result like this.. but know how to print it in pdf??</p>
  
  <pre><code>"id","did","email","mobile","slot","disease","age","gender","date", "18","1","jk@gmail.com","8528263923","morning-to-noon"," bjlk","bk","male","28-04-2016", 
  </code></pre>