[eluser]GamingFusion[/eluser]
I have a file that is supposed to delete a show from the database.
so i pass through to the function showDelete the thrid segemnt of the uri. but it doesnt do it all it does is pull up a blank page. i checked to make sure that the function is being called and it is.
heres my code
database model
Code:
function deleteShow()
{
$query = $this->db->delete('shows', array('id' => segement(3)));
if ($query) {
return $data['deleted'] = TRUE;
}else{
return $data['deleted'] = FALSE;
}
}
controller
Code:
function showDelete()
{
//Set Data
$data['title'] = 'Theater 311 | Remove Show';
$data['heading'] = 'Remove Show';
//Delete Show
$this->database->deleteShow();
//Load View
$this->load->view('deleteShow', $data);
}
and finally the view file
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?=$title?></title>
</head>
<body>
<?php
if ($deleted = TRUE) {
echo '<h1>Success!</h1>
<h3>The Show has Been removed</h3>';
}else{
echo '<h1>Failure!</h1>
<h3>The Show was not removed</h3>';
}
?>
</body>
</html>