"UPDATE #__comprofiler SET cb_textfield = '".$old->cb_textfield."', cb_checkboxfield = '".$old->cb_checkboxfield."' WHERE..."
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
UPDATE jos_comprofiler SET ... cb_ccprevious = 'CC33|*|CC36' … WHERE user_id = 853
Please Log in to join the conversation.
Please Log in to join the conversation.
You don't need PHP for this, if you're using MYSQL 5 (believe everyone is at this point) then you just use "ON DUPLICATE KEY UPDATE". Below is example of its usage.The script tests for a couple of things - mainly whether a registrant is already registered - and updates depending on the result so it seemed better to have one external script. Could be wrong though!
INSERT INTO `#__comprofiler` ( `id`, ``, `cb_ccprevious` ) VALUES ( [user_id], '[cb_ccprevious]' )
ON DUPLICATE KEY UPDATE `cb_ccprevious` = '[cb_ccprevious]';
IF EXISTS ( SELECT QUERY HERE )
UPDATE QUERY HERE
ELSE
INSERT QUERY HERE
Please Log in to join the conversation.