Hello
I am trying to put instead of “1” on the code below the value that is in the variable: $answer1
Basically answer1 is the column name in my database. $answer1 will hold a randomly generated number. Using this number that I need to append at the end I can get value from random fields.
How can I achieve this?
$row->answer1;
Tried this: $row->answer.+$answer1; but didnt work.
this looks like the underlying problem is a non-normalised database. having column names like answer1, answer2, etc. indicate a one-to-many relationship for which you should use a separate table (and foreign keys).