Jump to content

using $_GET for unique value retrieval?


MannyG

Recommended Posts

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

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.