Hello Everyone,
i have a question regarding de editable grid form, i’m using it because it gives the best visual results for what i’m trying to achieve. the form is made to display a set of questions that i have on a database. and the answers must be saved on another table. so i have something like this
Question_field Answer_field
QUESTION 1 ANSWER1
QUESTION 2 ANSWER2
QUESTION 3 ANSWER3
Question_field is a text field set to label so user cant change it and the values it show are the questions the users needs to answer.
Answer_field was created since it’s not part of the Question table and it’s a select field
I created a php button and instruct it to insert the values of both question_field and answer_field to another table with the following code:
$insert_table = ‘tb_eval_prof’; // Table name
$insert_fields = array( // Field list, add as many as nee
‘QUESTION’ => “{question_field}”,
‘ANSWER’ => “{answer_field}”
);
// Insert record
$insert_sql = ‘INSERT INTO ’ . $insert_table
. ’ (’ . implode(’, ‘, array_keys($insert_fields)) . ‘)’
. ’ VALUES (’ . implode(’, ', array_values($insert_fields)) . ‘)’;
sc_exec_sql($insert_sql);
the problem i have is that when i execute this SQL, both fields show no value, and i think is that i need to instruct wich row of the field i want to insert on each row of the database but i dont know how to do it.