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

These are not tested but give them a try, I would make sure to back up the database before
using these.

PHP Code:
$data = array(
    'item' => $post_array['employee_title'],
    'campaign' => $this->session->userdata('campaign'),
    'userid' => $this->session->userdata('userid')
);

$insertStr $this->db->insert_string('titles'$data);
$sql "INSERT IGNORE INTO"$insertStr);
$this->db->query($sql);

// or this one that escapes the data.

$this->db->query("INSERT IGNORE INTO titles(item, campaign, userid) VALUES ('" 
$this->db->escape($data['item']) . "', '" 
$this->db->escape($data['campaign']) . "', '" 
$this->db->escape($data['userid']) . "')"); 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: use of Unique in mySQL field cases Error - by InsiteFX - 07-22-2020, 09:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB