here is my code. I want to set the value of checkbox to be the value I am fetching from the database.
while($row=mysql_fetch_array($result2))
{
$n=$row['name'];
echo '<input type="checkbox" name="chkbox[]" value=$row["name"]>';
echo $n."<br>";
$i++;
}
More clearly, I am using a query to get 'names' from a database column and I have to use those names as values for consecutive checkboxes.
Maybe I am not able to explain my problem. I will try again. Suppose I have a variable $var="abc". I want to use $var as a value for a checkbox as in;
<type="checkbox" name="pqr" value='$var'>
In nutshell this is what I want to do, but its not working.