Page 1 of 1

UPDATE DATABASE

Posted: Sun Jan 16, 2011 4:53 am
by stalin
I am new to php.
I will pass the values from one php form to another php form.Then how to get the variable name.
<?php
$result = mysql_query("SELECT * FROM att");
if(mysql_num_rows($result)>0)
{
$i=0;
while($row = mysql_fetch_array($result))
{
$del=0;
$regno=$row['regno'];
$fname=$row['fname'];
$i++;
?>
<tr>
<td width="18%" height="42" align="center"><?php echo $i;?></td>
<td width="26%" align="center"><?php echo $regno;?></td>
<td width="28%" align="center"><?php echo $fname;?></td>
<td width="28%" height="42" align="center"><input type="checkbox" name="<?php echo $regno;?>" value="0"/></td>
</tr>
<?php
if($_REQUEST['regno']==0)
{
$count=$count+1;
}
}
echo "$count";
}

Re: UPDATE DATABASE

Posted: Sun Jan 16, 2011 5:04 am
by social_experiment
If you are using a form, don't use REQUEST. Go for $_POST. Your variable will then be in $_POST['NameOfRegNo'].