Hi, I want to insert checkboxes next to each query result with each checkbox name incrementing by one for each result. For example in the printf part of the code below I want compare1 to be compare2 for the next returned record and so forth.
The check boxes are in a single form that when submitted will limit the query to the checked records by their id. If anyone knows what code I can add to the following to autoincrement each checkbox name I would much appreciate it. I guess the checkbox name could just as well be 1, 2, 3 instead of compare1, compare2, compare3 if it makes it any easier Thanks!
if ($search) {
$result = mysql_query("SELECT * FROM tablename WHERE (keywords LIKE '%$keywords%')",$db);
if ($myrow = mysql_fetch_array($result)) {
echo " HTML table header stuff;
do {
printf("< tr >< td >< input type = checkb0x name=compare1 value=%s>< /td >< td >< a href=\"details?id=%s\">%s< /a >< /td >< td >%s< /td >< td >%s< /td >< td >\$%s< /td >< td >\$%s< /td >< td >\$%s< /td >< /tr >", $myrow["id"], $myrow["id"], $myrow["sitename"], $myrow["category"], $myrow["traffic"]);
}
while ($myrow = mysql_fetch_array($result));
}
else {
echo "Sorry there were no sites found in our database that matched your keywords.";
}
}