Jump to content

textbox values


chestnuth

Recommended Posts

Hi guys,

 

I have a bit of a problem with reading values out of a text box, any help would be great!

 

The while loops goes through a db table and passes out all the rows onto a form. Each row is a question that i need a answer from the user for so there is a text area associated with each question. like this:

 

<?php while($rowactivequestions=mysql_fetch_array ($resultactivequestions))

{

            $textareaid='Q'.$rowactivequestions['qid'];

$names.=$textareaid.' ';

            echo $rowactivequestions['question'];

echo '<br />'."\n";

echo '<textarea name="'.$textareaid.'" rows="5" cols="70">Answer.</textarea>'."\n";

echo '<input type="type" name="thenames" value="'.$names.'"/>'."\n";

echo '<br />'."\n";

echo '<br />'."\n";

}

?>

 

As the questions id's could be different every time the form loads i need to insert the question number and also the associated answer (from textarea) into the database.

As you can see the second input is where i am storing the question id values from the database, it looks something this at the moment (Q1, Q2, Q3, Q5) question 4 is missing as it does not satisfy the query that produces the list of questions.

 

how can i get each value (question id) from the textbox and also each answer from the text area and insert them to the database?

 

This has been annoying me for weeks.

 

any help would be great

 

Thanks

J

 

Link to comment
https://forums.phpfreaks.com/topic/94725-textbox-values/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.