I write code with $wpdb->insert comand in to the my wordpress database table (Names is wp_coin_price) . after inserted data in the table, then I write code to update all fields with ON DUPLICATE KEY UPDATE But I don’t know why its cant update fields … please help
$wpdb->insert( $wpdb->prefix . 'coin_price',
array(
'title' => trim($row->item(0)->nodeValue) ,
'liveprice' => trim($row->item(2)->nodeValue) ,
'changing' => trim($row->item(4)->nodeValue) ,
'lowest' => trim($row->item(6)->nodeValue) ,
'topest' => trim($row->item(8)->nodeValue) ,
'time' => trim($row->item(10)->nodeValue) ),
array(
'%s',
'%s',
'%s',
'%s',
'%s',
'%s'
) )."ON DUPLICATE KEY UPDATE
titile = VALUES('title' => trim($row->item(0)->nodeValue) ) ,
liveprice = VALUES('liveprice' => trim($row->item(2)->nodeValue) ) ,
changing = VALUES('changing' => trim($row->item(4)->nodeValue) ) ,
lowest = VALUES('lowest' => trim($row->item(6)->nodeValue) ) ,
topest = VALUES('topest' => trim($row->item(8)->nodeValue) ) ,
time = VALUES('time' => trim($row->item(10)->nodeValue) )";