Question

I need to display my database records in a table as rows but it displays as different tables. I am using codeigniter. please help me out.

this is my code http://kl1p.com/Takn

Was it helpful?

Solution

http://ellislab.com/codeigniter/user-guide/database/active_record.html

Codeigniter has not a data grid view if that's yoru question, the best way (and the ony one i know) is :

    $query = $this->db->get('mytable');

echo "<table>
        <th>
          <td>Title</td>
        </th>
        <tbody>
          <tr>";

foreach ($query->result() as $row){
    echo "<td>".$row->title."</td>";
}

echo "   </tr>
        </tbody>
      </table>";

OTHER TIPS

I can suggest you something like this : http://www.jeasyui.com/tutorial/datagrid/datagrid24.php and you can remove some propety as you wish. I think this is a good idea. I'm not professionnal but I'm trying to help. Hope you like it!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top