I have a questions that will take some explaining but should have a simple solution.
I create a form using info from a database. eg. I look for all rows with the title “teacher”. This might be rows 3, 8, and 14. My database might have a field called ‘class’. My form would then include three text fields named class_3, class_8 and class_14. I submit the form and query the database again the same way and get the same three rows (3,8, and 14). How can I update these database rows with the appropriate fields? I have tried using a do – while loop. While $row is equal to ‘3’ I want to get the value of $class_3. I tried this but it doesn’t work.
[code=php]mysql_query (“UPDATE database SET class=’$class_$row’ WHERE row=$row “);
‘$class_$row’ is not the right way to do this. I hope I explained this clear enough and that someone can give me a simple solution.