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";
}
UPDATE DATABASE
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: UPDATE DATABASE
If you are using a form, don't use REQUEST. Go for $_POST. Your variable will then be in $_POST['NameOfRegNo'].
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering