Welcome Guest, Not a member yet? Register   Sign In
use of Unique in mySQL field cases Error
#10

(This post was last modified: 07-23-2020, 06:03 AM by richb201.)

Insite,

still not working, I tried it both with the item field set to unique and not. Is there a log for mysql errors?
$data = array(
    'item' => $post_array['cost_center'],
    'campaign' => $this->session->userdata('campaign'),
    'userid' => $this->session->userdata('userid')
);
$string="INSERT IGNORE INTO exclude_choices(item, campaign, userid) VALUES (" . $this->db->escape($data[item]) . ", " .$this->db->escape($data[campaign]) . ", " .$this->db->escape($data[userid]) . ")";
$this->db->query($string);


You realize that this is being called within a callback and the original table in the controller is "employees" and not "exclude_choices"? I found some mention of moving the code dealing with another table into a function in "model" rather than in the controller. Any commentary on this plan? 
proof that an old dog can learn new tricks
Reply


Messages In This Thread
RE: use of Unique in mySQL field cases Error - by richb201 - 07-22-2020, 11:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB