[eluser]TheFuzzy0ne[/eluser]
Oh, and in case you're wondering, $this->db->affected_rows() is passing back the number of affected rows from the last database query.
Code:
function update_company($id) {
$company_name = htmlspecialchars($this->input->post('company_name'));
$company_city = htmlspecialchars($this->input->post('company_city'));
$company_bio = htmlspecialchars(trim($this->input->post('company_bio')));
$update_company = "UPDATE `user_company` SET"
. " `company_name` = '".$company_name. "',"
. " `company_city` = '".$company_city. "',"
. " `company_state` = '".$this->input->post('company_state'). "',"
. " `company_industry` = '".$this->input->post('company_industry'). "',"
. " `company_years` = '".$this->input->post('company_years'). "',"
. " `show_in_search` = '".$this->input->post('show_in_search'). "',"
. " `company_bio` = '".$company_bio. "' WHERE (`user_id` = '".$id."')";
$this->db->query($update_company); /* --The missing statement-- */
$updated = $this->db->affected_rows($update_company);
if($updated > 0) {
return true;
} else {
return false;
}
}
The above code is
untested.