[eluser]echoDreamz[/eluser]
[quote author="clutton" date="1286227451"]Hi all,
I have been just starting out with some PHP coding and am interested in using data and storing data back to our IBM DB2 database where our ERP system resides. I have been attempting to use the db2c drivers from the wiki page but am having trouble when trying to insert data. My code looks like this:
Code:
function addDriver($name) {
//$data = array(
// 'DR_NAME' => $name
//);
//$this->db->insert('drivers', $data);
$sql = "INSERT INTO drivers (dr_name)
VALUES (".$this->db->escape($name).")";
$this->db->query($sql);
}
I have tried it using both ways above and they do not seem to submit the query when a value is in the "name" variable. The fun part is that it works if $name is blank. It is probably something very simple but I am not seeing it. Anyone using the db2c driver with any luck on an iSeries? Thanks in advance for any suggestions.[/quote]
Try
Code:
$sql = "INSERT INTO drivers (dr_name) VALUES ('{$this->db->escape($name)}')";