rows |
[eluser]mom_maj[/eluser]
hi i need help for that i have a small project i need to bring data from DB and print it i in a table that is the code what wrong with that : model: function viwe() { $this->user_model->islogin(); $user_id = $this->session->userdata('user_id'); //connect to DB $sql = "SELECT * FROM list WHERE user_id= '$user_id' "; $query = $this->db->query($sql); if ($query->num_rows() == 0){ echo'no item in your list'; } else { $row = $query->result(); $this->load->view('view'); } } and view: <html> <form method="POST" action="delete"> <table border='1'> <tr><th>X</th> <th>Title</th> <th>Description</th><th>Status</th><th>Date</th><th>Action</th></tr> <?echo 'This Is The List Of Your Order';?> <tr><td> <?echo "<input type='checkbox' name=\"checked[]\" value=\"$row->todo_id\">";?> </td><td> <?echo $row->title?> </td><td> <?echo $description?> </td><td> <?echo $status?> </td><td> <?echo $update_date?> </td><td> <?echo "<a href=\"http://localhost/codeigniter/index.php/todo/to_edit\"> edit</a>" ;?> </td></tr> </form> <table> <tr><td><input type="submit" value="Delete Todo"></td> <td align="center"><a href = http://localhost/codeigniter/index.php/todo/back>GO back</a></td></tr> </table> </html> |
Messages In This Thread |
rows - by El Forum - 02-14-2008, 05:50 AM
rows - by El Forum - 02-14-2008, 06:21 AM
rows - by El Forum - 02-14-2008, 06:34 AM
rows - by El Forum - 02-14-2008, 06:42 AM
rows - by El Forum - 02-14-2008, 06:46 AM
|