embedding mysql output in checkbox
Posted: Tue Oct 20, 2015 11:08 am
Hi There,
I've browsed different pages, watched videos; but to no success I've been able to figure out on how to show mysql output in a checkbox. I'm pulling data from mysql, displaying them in a tabular format, using td, tr.
My goal is to select few entries, and send them to another page for processing. But I'm unable to get the value displayed here on php-html page.
I see a empty td with check box, my value isn't shown. Forward primer is shown if I echo it, but not displayed on the table.
I've browsed different pages, watched videos; but to no success I've been able to figure out on how to show mysql output in a checkbox. I'm pulling data from mysql, displaying them in a tabular format, using td, tr.
My goal is to select few entries, and send them to another page for processing. But I'm unable to get the value displayed here on php-html page.
I see a empty td with check box, my value isn't shown. Forward primer is shown if I echo it, but not displayed on the table.
Code: Select all
foreach ($result as $row){
echo "<tr>"; //row
echo "<td>"."<input name=study[] disabled value=".$row['study']." </td>";
$value_for=$row['forward_primer'];
echo "<td> <input type=checkbox name=check[] value=$value_for/></td>"; //show check box here
echo "<td>"."<input name=reverse_primer disabled value='".$row['reverse_primer']."' /></td>";
echo "<td>"."<input name=seq_platform disabled value='".$row['seq_platform']."' </td>";
//'' to have spaces shown
echo "</tr>"; //row ends
}