Welcome Guest, Not a member yet? Register   Sign In
Script problem
#1

[eluser]macleodjb[/eluser]
Hi guys, i have this upload script that i've created and i'm having a problem with it and don't know why. I've checked all the keys to see if they are incorrect and they are all fine.

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."')";
        $updated = $this->db->affected_rows($update_company);
            if($updated > 0) {
            return true;
            } else {
            return false;
            }
    }

my problem is that it will show that the information has been updated successfully, but when you go to the database it hasnt' changed. Is there a problem with using the post variables nested within htmlspecialchars() function? or is there another problem with this?


Messages In This Thread
Script problem - by El Forum - 02-21-2009, 02:26 PM
Script problem - by El Forum - 02-21-2009, 02:36 PM
Script problem - by El Forum - 02-21-2009, 02:37 PM
Script problem - by El Forum - 02-21-2009, 02:39 PM
Script problem - by El Forum - 02-21-2009, 02:47 PM
Script problem - by El Forum - 02-21-2009, 02:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB