Welcome Guest, Not a member yet? Register   Sign In
$this->db->delete() alwas returns true
#1

[eluser]Unknown[/eluser]
I dont understand this.

Model:

Code:
function delete_tournament($rowid)
    {
        return $this->db->delete('tournament', array('tournament_id' => $rowid));
    }

Controller:

Code:
$result = $this->m_tournaments->delete_tournament($id);
            
            $cssfilename = array('css' => 'tournaments.css', 'id' => $id, 'result' => $result);
            $this->masterpage->setMasterPage ( 'v_master' );
            $this->masterpage->addContentPage ( 'v_query_result', 'content', $cssfilename );
            $this->masterpage->show();

View:

Code:
<div class="query_result_div">
    &lt;?php if($result == TRUE) { echo $result; } else if($result == FALSE) { echo $result; } ?&gt;
</div>

If i send an id to the delete function i know 100% dont have a corresponding row i still always echo 1. I feel like im missing something obvious here.

/Thanks




Theme © iAndrew 2016 - Forum software by © MyBB