Hi Chad,
Thanks for your help, unfortunately, the script didn't work. It needed a
little modification. If I selected two items and clicked submit, it would
still return everything in the table.
here is my code:
<?
print '<form action='.$PHP_SELF.'>';
?>
<table border="1" width="100%">
<tr>
<td width="28%" align="center"><b>Product Id:</b></td>
<td width="28%" align="center"><b>Product Name:</b></td>
<td width="29%" align="center"><b>Product Description:</b></td>
<td width="15%" align="center"><b>Check To List:</b></td>
</tr>
<?php
$user = "username";
$pass = "password";
$db = "databasename";
$table = "tablename";
$link = mysql_connect ( "localhost", $user, $pass );
mysql_select_db ( $db, $link ) or die ( "couldn't open $db:
".mysql_error() );
$sql = "select * from $table";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
print"<tr>";
printf("<td width='28%%'>%s</td>\n",$row["PRODUCTID"]);
printf("<td width='28%%'>%s</td>\n",$row["PRODUCTNAME"]);
printf("<td width='29%%'>%s</td>\n",$row["DESCRIPTION"]);
printf("<td width='15%%'><input type='checkbox' name='%s'
value=\"%s\">Add</td>\n",$row["PRODUCTNAME"],$row["PRODUCTID"]);
print"</tr>";
}
?>
</table>
<p><input type="submit" value="Add These Please" name="getgoing">
</form>