• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
STRANGE SQL update error... Help Anyone RESOLVED

#1
[eluser]Unknown[/eluser]
Quote: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 'table = '', semetry = 'semetry', polish = 'polish', girdle = '', culet = '', flo' at line 1

UPDATE ss_products_attributes SET diamond = '', carat_weight = '', color = '', fancy_color = '', cut = 'cut', clarity = 'clarity', depth = '', table = '', semetry = 'semetry', polish = 'polish', girdle = '', culet = '', floresence = 'floresence', measurement = '' WHERE products_id = '2'

I keep gitting the error can anyone tell me what maybe the cause

here is the code

Code:
$pd = array(
        
        'diamond' => $_POST['diamond'],
        'carat_weight' => $_POST['carat_weight'],
        'color' => $_POST['color'],
        'fancy_color' => $_POST['fancy_color'],
        'cut' => $_POST['cut'],
        'clarity' => $_POST['clarity'],
        'depth' => $_POST['depth'],
        'table' => $_POST['table'],
        'semetry' => $_POST['semetry'],
        'polish' => $_POST['polish'],
        'girdle' => $_POST['girdle'],
        'culet' => $_POST['culet'],
        'floresence' => $_POST['floresence'],
        'measurement' => $_POST['measurement']
        );
        //$this->gen_db->update_data_set('ss_products_attributes',"products_id = '{$_POST['products_id']}'",$pd);
        $this->db->where("products_id = '{$_POST['products_id']}'");
        $this->db->update('ss_products_attributes', $pd);

#2
[eluser]rogierb[/eluser]
'TABLE' is a reserved word, so you can't use it.

See http://dev.mysql.com/doc/refman/5.0/en/r...words.html for more info on reserved words

So change it to table_1 or something and it will work.

#3
[eluser]Unknown[/eluser]
Thanks a Mil.... man I need to get some sleep


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.