transfield
01-24-2008, 01:47 PM
Hello,
I have queried a MySQL database & displayed the results on a page. These results have checkboxes next to each record just like Yahoo Mail. The code is below & is working fine.
Now, the next thing I want to do is to tick a few checkboxes and display only the ticked records on a new page for printing purposes. How do I do this?
Thanks.
<form name="form1" method="POST" action="">
<?php
//connect to the database here
$result = mysql_query("SELECT username FROM users WHERE user_posts = 0
AND username != 'Anonymous' AND user_regdate < $four_months");
while ($row = mysql_fetch_array($result))
{
echo "<input type='checkbox' name='boxes[]' value='{$row
['user_id']}'>" . " " . $row['username'];
echo "<br>";
}
?>
</form>
I have queried a MySQL database & displayed the results on a page. These results have checkboxes next to each record just like Yahoo Mail. The code is below & is working fine.
Now, the next thing I want to do is to tick a few checkboxes and display only the ticked records on a new page for printing purposes. How do I do this?
Thanks.
<form name="form1" method="POST" action="">
<?php
//connect to the database here
$result = mysql_query("SELECT username FROM users WHERE user_posts = 0
AND username != 'Anonymous' AND user_regdate < $four_months");
while ($row = mysql_fetch_array($result))
{
echo "<input type='checkbox' name='boxes[]' value='{$row
['user_id']}'>" . " " . $row['username'];
echo "<br>";
}
?>
</form>