I'm working on the same problem but I need to read the code, not write
it:, here are a few links and my code if you might help me in return:


my code:

mysql_db(); # connects to mysql

for($i = 0; $i < sizeof($check); $i++) {
# echo $i;
# echo '<p>';
# $data = $check[$i];
$sql = ("SELECT * FROM kodak_user_pictures WHERE ID = '$check[$i]'");
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
# $row = mysql_fetch_array($db_data);
$db_ID = $row["ID"];
$db_picture_name = $row["picture_name"];
echo $db_ID;
echo '<p>';
echo $db_picture_name;
echo '<p>';
echo $ID;
echo '<p>';
echo $picture_name;
echo '<p>';
echo $result;

so many echoes because I'm trying to figure out what works and what

- Victor > www.argilent.com

-----Original Message-----
From: Smita Manohar [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 30, 2002 12:19 AM
Subject: [PHP-DB] How to pass multiple checkbox values thru form??

i have one form in which i print records from mysql database. while 
displyaing those records i display one checkbox with each record. i want
user should select the checkbox corresponding to the record which s/he
to delete.

i display those records after running one query. hence each time no.of 
records are diff. so its difficult to hard code names for check boxes.
name attribute in <input type=checkbox> tag, i define one array. having
name as the key field in the table. and value for which is also set 

<FORM NAME = "act_qmd_subj_frm" METHOD = "POST" ACTION = 

while ($row = mysql_fetch_array($result))

         echo "<tr>";

       //call function to display the contents of $row in table

        print "  <td valign=top align=center><input type=checkbox  
name=\"subj_id[]\" value=\"".$row["subj_id"]."\"> Yes, delete entry 



     <INPUT TYPE="submit" NAME="del_but" VALUE="Delete"> &nbsp &nbsp
     <INPUT TYPE="submit" NAME="modify_but" VALUE="Modify"> &nbsp &nbsp
     <INPUT TYPE="reset" NAME="clear_but" VALUE="Clear"> &nbsp &nbsp


when i submit the form to confirm_delete.php i run one code there to
the array subj_id[]  which is supposed to contain values of the
which are selected to delete or to modify. but the array subj_id[]
no value at all. echo count($subj_id) gives 0.

is there any other way to pass multiple checkbox values from the form???

i got the above trick from the book "MySQL/PHP Database Applications"
Jay Grrenspan and Brad Bulger) in one script they have passed checkbox
thru array by this way, and its working fine.

can anyone PLS figure out what wrong im doing???

thnx and regds,

MSN Photos is the easiest way to share and print your photos: 

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Post your ad for free now! http://personals.yahoo.ca

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to