Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

Apagar uma nota (não funciona)

$
0
0
o meu "model"
Código (PHP):
public function delete($id) {
   $this->db->delete('note', "`noteid` = {$data['noteid']} AND userid = '{$_SESSION['userid']}'");
  }

View
Código (PHP):
<?php

foreach ($this->noteList as $key => $value) {
  echo '<tr>';
  echo '<td>' . $value['title'] . '</td>';
  echo '<td>' . $value['date_added'] . '</td>';
  echo '<td><a href="'. URL . 'note/edit/' . $value['noteid'].'">Edit</a></td>';
  echo '<td><a class="delete" href="'. URL . 'note/delete/' . $value['noteid'].'">Delete</a></td>';
  echo '</tr>';
}
?>

controller
Código (PHP):
public function delete($id) {
   $this->model->delete($id);
   header('location: ' . URL . 'note');
  }

para não estar a escrever tudo apenas copiei do escrito para os utilizadores para as notas. Nos utilizadores funciona tudo perfeitamente mas para as notas não :s Não me apaga a nota.

Viewing all articles
Browse latest Browse all 14700

Trending Articles