//you must make some change :
echo "<td><input type=\"checkbox\" name=\"frm_".$pid."\" value =
\"$pid\"></td>";

^^^^^^^^^^

//you must find the max pid from database with query
//"select pid from catalog order by pid desc limit 1"
for ($i=0;$i<max_pid;$i++)
    {
   $v="pid_".$i;
   if(isset($$v)) ... make what you want to do .....;
    }


--


Best regards,
George Nicolae
IT Manager
___________________
X-Playin - Professional Web Design
www.x-playin.f2s.com



"David Jackson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> ALL --
> The snipet below is used to generate the table containing
> product info (product_id(pid), title, amount) and checkboxs.
> When submit is clicked the data is passed to "instert into"
> sql statement.
>
> My question is how do I process checkbox when multi boxes have
> been check. I keep thinking a array is created by check boxes?
> -- David
>
> --------  order_form.php --------
> // Define table
> echo "<br><table bgcolor=\"gray\" border=\"1\" >";
> // Generate book listing
> $result = mysql_query("SELECT pid,date,title,subtitle,author,amount FROM
> catalog ") or die("Dis ain't right !!");
> while (
>
list($pid,$date,$title,$subtitle,$author,$amount)=mysql_fetch_row($result)){
> echo "<tr>\n";
> echo "<td><input type=\"checkbox\" name=\"frm_pid\" value = \"$pid\"
> ></td>";
> echo "<td>$title</td>";
> echo "<td>Price: $amount</td>";
> echo "</tr>\n";
> }
> echo "</table>";
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to