...

View Full Version : Tick Checkbox & Display Selected Records



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']}'>" . "&nbsp;" . $row['username'];
echo "<br>";
}
?>
</form>

abduraooft
01-24-2008, 02:28 PM
<input type='checkbox' name='boxes[]' value='{$row['user_id']}'>
user_id is not selected in the query.

<input type="checkbox" checked> will do the trick!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum