This is The Error I am getting..
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
Sensor= 'sklfj',Lens= 'lkjsdf',IR= 'lkjdsf',Audio= 'kjlasf', `WDR' at line 1
UPDATE `hdtvicameras_spec`
SET `Resolution` = 'd',
`Image` `Sensor` = 'sklfj',
`Lens` = 'lkjsdf',
`IR` = 'lkjdsf',
`Audio` = 'kjlasf',
`WDR` = 'lkjsf1',
`ICR` = 'klasjf',
`IP` `Rating` = 'lkjsdf',
`Zoom` = 'ljs'
WHERE
`product_id` = '46'
Product_model.php
$this->db->where('product_id', $product_id);
$this->db->update($tbname, $spec_array);
After var_dump($spec_array) this is what I get
array(10) {
["Resolution"]=> string(5) "first"
["Image Sensor"]=> string(6) "second"
["Lens"]=> string(6) "third "
["IR"]=> string(6) "fourth"
["Audio"]=> string(6) "fifthe"
["WDR"]=> string(6) "sisxth"
["ICR"]=> string(5) "seven"
["IP Rating"]=> string(5) "eight"
["Zoom"]=> string(4) "nine"
["SD Card"]=> string(3) "ten"
}
All those key values in array are fetched from database which is specification names of any product.
looks like there is some error with space in key name. Can anybody help me solve this?
ImageSensortoImageSensoror some thing else in to your$spec_array.