MannyG Posted April 26, 2010 Share Posted April 26, 2010 Hey I am using a form that within it has a while loop which displays information from a database. There are 43 rows of data shown and in that while loop there are two input fields being created where the user can enter the results. Now I realized I need to have a unique name for these fields, so I did this. <?php $num=0; while($results = mysql_fetch_array($sql)){ echo"<tr>"; echo "<td class='TCID' BGCOLOR='#99CCFF'>".$results['testcase_num']."</td>"; echo "<td class='ID' >".$results['name']."</td>"; echo "<td class='JSR' BGCOLOR='#99CCFF'>".$results['JSR']."</td>"; echo "<td class='info' >".$results['description']."</td>"; echo "<td class='result' BGCOLOR='#99CCFF'><input type='text' name='result".$num++."' value=''></td>"; echo "<td class='comment'><input type='text' name='comment' value=''></td>"; echo"</tr>"; } ?> where the input field 'result' is unique as I am incrementing it for each instance. So in my other page where it retrieves the form data I want to retrieve each specific data for the unique result value...but I dont know how to do this... I tried : <?php $results = $_GET['result']; echo $results; //AND for($int =0; $int<41;$int++){ $record = $_GET['result'$int]; echo $record; } ?> but im just taking wild guesses here Link to comment https://forums.phpfreaks.com/topic/199844-using-_get-for-unique-value-retrieval/ Share on other sites More sharing options...
MannyG Posted April 26, 2010 Author Share Posted April 26, 2010 oops never mind I got it..hehe I forgot to add the '.' between result and int so final for loop looks like this... for($int =0; $int<44;$int++){ $record = $_GET['result'.$int]; echo $record; } sorry.. Link to comment https://forums.phpfreaks.com/topic/199844-using-_get-for-unique-value-retrieval/#findComment-1048970 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.