what wrong |
[eluser]mom_maj[/eluser]
thats code performed i bring many row from DB and pass it to view page ,it give me error and that is : A PHP Error was encountered Severity: Notice Message: Undefined variable: row Filename: views/view.php Line Number: 16 my cod is: 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){ $this->load->view('view'); $comment=array('no_list'=> 'There Are No List In The Data Base'); $this->load->vars($comment); } else { $row =$query->result_array(); $this->load->view('view',$row); } } view: <?php ?> <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';?> <?php foreach ($query->result_array() as $row) {?> <tr><td> <?echo "<input type='checkbox' name=\"checked[]\" value=\"$row[todo_id]\">";?> </td><td> <?echo $row['title']?> </td><td> <?echo $row['description']?> </td><td> <?echo $row['status']?> </td><td> <?echo $row['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 |
what wrong - by El Forum - 02-14-2008, 10:03 AM
what wrong - by El Forum - 02-14-2008, 10:10 AM
what wrong - by El Forum - 02-14-2008, 12:00 PM
|