Problems, need help? Have a tip or advice? Post it here.
12 posts Page 2 of 2

Hi,

A comma-separated string of IDs will set multiple values into a relation field e.g. as follows
Code: Select all
response_details='31, 54, 56, 102'

You can aggregate the insert_ids into such a string to do what you mentioned.

As an aside, I see from your code that you are using values taken directly from $_POST. That is perfectly fine but to be on a safer side, you should sanitize the value as follows -
Code: Select all
<cms:php>
    global $CTX, $FUNCS;

    ..
    $question = $FUNCS->cleanXSS( $_POST["$questionNo"] );
    $answer = $FUNCS->cleanXSS( $_POST["$answerNo"] );
    ..
</cms:php>   

Hope it helps.

Cool, that worked . Appreciate your help, thanks :)
12 posts Page 2 of 2