PHP - Problem With Checkboxes To Delete Multiple Entries
Hi, I want to build into my html table that populates my database table to have a column for checkboxes with a delete button that takes the user to another page to confirm the deletion by outputting a message: Are you sure you want to delete ____, followed by a for loop to see how many checked records to get its ID in order to get its appropriate name. So I have a submit button with name attribute of "delete0" and the values of the input type of checkbox is $row['ID'], for some reason, I get the notice: "Notice: Undefined index: modifyArray in C:\display.php" and modifyArray is the name I give to the checkbox attribute (please see this in my display.php below)
Here is my display.php Code: [Select] <table border="border"> <!--NB: checkbox form for multiple delete/update/insert--> <form method="post" action=""> <input type='submit' value='DELETE' name='delete0' /> <?php session_start(); require 'bellSessionDisconnect.inc'; require 'bellConnect.inc.php'; $result=mysql_query("SELECT ID, Image, Name, Manufacturer, Price, Description, SimSupport FROM bellProducts"); //phpinfo(); //NB: print table headings if(mysql_num_rows($result))//if there is at least one entry in bellProducts, make a table { //$counter+=1; print "<table border='border'>"; print "<tr> <th>ID</th> <th>Select entries to modifiy</th> <th>Image</th> <th>Name</th> <th>Manufacturer</th> <th>Price</th> <th>Description</th> <th>SimSupport</th> <th colspan='2' align='center'>Modify</th> </tr>"; //NB: now output each row of records while($row=mysql_fetch_assoc($result)) { //extract($row); "<tr align='center'> <td>$row[ID]</td> <td><input type='checkbox' name='modifyArray[]' value='$row[ID]' /></td> <td>"; if(!empty($row['Image'])) { $curImage=$row['Image']; } else if(empty($row['Image'])) { $curImage='fileUploadIcon.jpg'; //$title="please upload item image"; } print "<img src=$curImage width='70px' height='90px' /> </td> <td> $row[Name] </td> <td> $row[Manufacturer] </td> <td> $$row[Price]</td> <td align='left'>$row[Description]</td> <td>$row[SimSupport]</td> <td><a href='bellUploadForm.php?ID=$row[ID]'>UPLOAD IMAGE</a></td> <td><a href='bellUpdateForm.php?ID=$row[ID]'>UPDATE</a></td> </tr>"; //}//END INNER IF }//END WHILE }//END BIG IF ?> <?php if(array_key_exists('delete0', $_POST)) { $modifyArray=$_POST["modifyArray"]; if(!empty($modifyArray)) { header("Location: http://localhost/bellDeleteForm.php"); exit(); } } ?> </form> </table> I will worry about redirecting to bellDeleteForm.php to confirm the records the user wants to delete after I get this going, please help!!! thanks Similar TutorialsHi guys Im trying to delete multiple images from a page with the code below, I have retirieved the images successfully but i can not delete the with checkbox, wht it does is just refereshing the page and thats it, what im trying to do is to delete the image from the database but it wont. can u help me please? <?php session_start(); include ("../../global.php"); //welcome messaage $username=$_SESSION['username']; echo "$username"; $query=mysql_query("SELECT id FROM users WHERE username='$username'"); while($row = mysql_fetch_assoc($query)) { $user_id = $row['id']; } $ref=$_GET['reference']; $images=mysql_query("SELECT * FROM img WHERE refimage='$ref'"); while($row = mysql_fetch_array($images)) { $image=$row['image']; $thumb=$row['thumb']; ?> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td><form name="" method="post" action=''> <tr> <td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id']; ?>"></td> <td bgcolor="#FFFFFF"><? echo "<a href='$image' rel='lightbox[roadtrip]'><img src= '$thumb' width='60' height='40' alt='$title'>";?></td> <? } ?> <tr> <td colspan="5" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="Delete"></td> </tr> <?php // Check if delete button active, start this $delete = $_REQUEST['delete']; if( $delete != '' ){ $checkbox = $_REQUEST['checkbox']; $count = count($_REQUEST['checkbox']); for($i=0;$i<$count;$i++){ $del_id = $checkbox[$i]; $del = mysql_query("DELETE FROM img WHERE id = '$del_id'"); } } ?> Hello, I'm requesting your help here cause I'm really confused. I'm looking for deleting entries when an image doesn't load on my links test. I got all my links in a .txt file like this : links.txt = Code: [Select] <div class="gallery"> <a href="http://www.website.com/page"> <img src="http://tc16.easythumbhost.com/image.jpg" onerror="ImgError(this)"/> </a> </div> #enddiv the "onerror" code in img src sends an "Image Missing" pic. What I'd want is to change the "onerror" function to open a php script which deletes all the lines of the div. This is the script I use to show the links on my page : Code: [Select] $links = "links.txt"; $fd = fopen ($links, "r"); $content = fread ($fd,filesize ($links)); fclose ($fd); $delimiter = "#enddiv"; $splitcontent = explode($delimiter, $content); $output = array_slice($splitcontent, 0,100); foreach ( $output as $divs ) { echo "$divs"; } I've searched hours and tried lots of codes before posting Help would be very appreciated. Thanks. Maybe some of the great coders here can help this noob out. So here is what I have so far: Code: [Select] //set age criteria for deletion $age = 60; //get current date $datenow = date("Y-m-d"); //set the range we want to delete $delete_range = $datenow - $age; //get old user_id from users table $oldusers_users = mysql_query ("SELECT user_id FROM users WHERE lastvisit < $delete_range "); //get user_id from images table that correspond to users table $oldusers_images = mysql_query ("SELECT user_id FROM images WHERE $oldusers_users=user_id.images "); //find folders that correspond to the usernames and delete $oldusers_files = mysql_query ("SELECT username FROM users WHERE lastvisit < $delete_range "); //print out username //$result = mysql_($oldusers_files); $foldername = mysql_result($oldusers_files, 0); $sigspath = "sigs/"; unlink($sigspath . $foldername . ".gif/index.php"); rmdir($sigspath . $foldername . ".gif"); //now delete user_id's from database mysql_query("DELETE * FROM users WHERE user_id=$oldusers_users"); mysql_query("DELETE * FROM images WHERE user_id=$oldusers_images"); unset($oldusers_users, $oldusers_images, $oldusers_files, $foldername, $sigspath ); mysql_close($link); Right now it is only returning the first entry, not the entire list that meets the criteria. It does delete that one file though but does not remover the rows from the database. I am sure the database stuff is jacked up I am really new to that part. What am I doing wrong here or is there a better way to do this perhaps Hi, my PHP code currently outputs the results from a users search by querying a backend postgresql database. As result/row is retuned to the user i would like to be able to detect whether or not they have checked a checkbox at the end of each rown in which case multiple rows can then be deleted from the database upon the user clicking a 'delete multiple records' button. I have no problem in being able to display the checkboxes on the webpage but i am a little unsure as to how to refernce them and detect which ones the user has checked. Given my database stores hostnames/IP addresses would it be best to name each checkbox to reflect the hostname or name the value it returns when checked to reflect the hostname. Given the above and that I also store the results of a users search in a $_SESSION['hosts'][][] array how can I then tie the two together? Thanks for reading. I have a form where a user can duplicate part of a form like below: I've named the fields with the HTML arrays (ie. "fieldName[]") and came up with this: //--> CONTROLLERS $system_controllers_qty = $_POST['system_controllers_qty']; $system_controllers_make = $_POST['system_controllers_make']; $system_controllers_model = $_POST['system_controllers_model']; $system_controllers_serial_no = $_POST['system_controllers_serial_no']; for ($i = 0; $i < count($system_controllers_qty); $i++) { echo "qty " . clean($system_controllers_qty[$i]) . "<br/>"; echo "make " . clean($system_controllers_make[$i]) . "<br/>"; echo "model " . clean($system_controllers_model[$i]) . "<br/>"; echo "serial_no " . clean($system_controllers_serial_no[$i]) . "<br/>"; } //--> CPUS $system_cpus_qty = $_POST['system_cpus_qty']; $system_cpus_model = $_POST['system_cpus_model']; $system_cpus_serial_no = $_POST['system_cpus_serial_no']; $system_cpus_speed = $_POST['system_cpus_speed']; for ($i = 0; $i < count($system_cpus_qty); $i++) { echo "qty " . clean($system_cpus_qty[$i]) . "<br/>"; echo "model " . clean($system_cpus_model[$i]) . "<br/>"; echo "serial_no " . clean($system_cpus_serial_no[$i]) . "<br/>"; echo "speed " . clean($system_cpus_speed[$i]) . "<br/>"; } //--> DISKS $system_disks_qty = $_POST['system_disks_qty']; $system_disks_make = $_POST['system_disks_make']; $system_disks_model_no = $_POST['system_disks_model_no']; $system_disks_size = $_POST['system_disks_size']; $system_disks_serial_no = $_POST['system_disks_serial_no']; for ($i = 0; $i < count($system_disks_qty); $i++) { echo "qty " . clean($system_disks_qty[$i]) . "<br/>"; echo "make " . clean($system_disks_make[$i]) . "<br/>"; echo "model_no " . clean($system_disks_model_no[$i]) . "<br/>"; echo "size " . clean($system_disks_size[$i]) . "<br/>"; echo "serial_no " . clean($system_disks_serial_no[$i]) . "<br/>"; } //--> MEMORY $system_memory_qty = $_POST['system_memory_qty']; $system_memory_serial_no = $_POST['system_memory_serial_no']; $system_memory_manf = $_POST['system_memory_manf']; $system_memory_part_no = $_POST['system_memory_part_no']; $system_memory_size = $_POST['system_memory_size']; for ($i = 0; $i < count($system_memory_qty); $i++) { echo "qty " . clean($system_memory_qty[$i]) . "<br/>"; echo "serial " . clean($system_memory_serial_no[$i]) . "<br/>"; echo "manf " . clean($system_memory_manf[$i]) . "<br/>"; echo "part_no " . clean($system_memory_part_no[$i]) . "<br/>"; echo "size " . clean($system_memory_size[$i]) . "<br/>"; } This just outputs all the fields I post at the moment. Say I have 3 different disk types, it's going to loop 3 times. Is it possible to make this all into 1 giant query or am I better off doing each query separately? Each section is a different table. Hi, I need some help figuring out my problem. I currently have a script that retrieves records from a mysql database, then has checkboxes to enable to delete a record? Any help where I might be going wrong as it displays, but doesn't delete?? Thanks Code: [Select] <?php require_once('includes/config.php'); $sql="SELECT * FROM members ORDER BY member_id"; $result=mysql_query($sql); $count=mysql_num_rows($result); ?> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td><form name="form1" method="post" action=""> <table width="413" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td colspan="5" bgcolor="#FFFFFF"><strong>Delete a Member</strong> </td> </tr> <tr> <td width="48" align="center" bgcolor="#FFFFFF">#</td> <td width="42" align="center" bgcolor="#FFFFFF"><strong>Id</strong></td> <td width="129" align="left" bgcolor="#FFFFFF"><strong>First Name</strong></td> <td width="152" align="left" bgcolor="#FFFFFF"><strong>Last Name</strong></td> <td width="152" align="left" bgcolor="#FFFFFF"><strong>Email</strong></td> </tr> <?php while($rows=mysql_fetch_assoc($result)){ ?> <tr> <td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['member_id']; ?>"></td> <td align="center" bgcolor="#FFFFFF"><? echo $rows['member_id']; ?></td> <td align="left" bgcolor="#FFFFFF"><? echo $rows['firstname']; ?></td> <td align="left" bgcolor="#FFFFFF"><? echo $rows['lastname']; ?></td> </tr> <?php } ?> <tr> <td colspan="5" align="left" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="Delete"></td> </tr> <? // Check if delete button active, start this if($delete){ for($i=0;$i<$count;$i++){ $id = $checkbox[$i]; $sql = "DELETE FROM members WHERE member_id='$id'"; $result = mysql_query($sql); } // if successful redirect to delete_multiple.php if($result){ echo "<meta http-equiv=\"refresh\" content=\"0;URL=delete-member.php\">"; } } mysql_close(); ?> </table> </form> </td> </tr> </table> Hey everyone i having some trouble updating records in my databse using checkbox from a form. I can update the records, but i can't figure out how to remove records at the same time. I've posted the code that i'm using to update below foreach($_POST['tag'] as $k=>$l){ $tag = mysql_real_escape_string($_POST['tag'][$k]); $check_tags = mysql_query("SELECT * FROM file_cats WHERE category='$tag'") or die(mysql_error()); $num_tags = mysql_num_rows($check_tags); if($num_tags==0){ $add_tag = mysql_query("INSERT into file_cats (fileID, category) VALUES('$fileID', '$tag')") or die(mysql_error()); } } This code inserts new records based on what the user checked. If it exist it won't add a new row, if it doesn't exist then it will add a new row. but like i said how can remove a row if the box is no longer checked? I've tried using foreach(empty($_POST['tag'] as $k => $l){ $tag = empty($_POST['tag']['$k']; } But that didn't work basically nothing was deleted. Has anyone done something like this before? if so i would appreciate any help you could give This topic has teleported to Third Party PHP Scripts. Beam me up, Scotty. http://www.phpfreaks.com/forums/index.php?topic=343682.0 Ok so i want to grab an id from the checkbox then grab the option drop down associated with that check box and update a mysql row here is my code so far any help is awesome help taaaanks guys <?php mysql_connect("localhost", "root", "root") or die(mysql_error()); mysql_select_db("db1") or die(mysql_error()); $query = "SELECT * FROM tickets ORDER BY id DESC"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { print "<input name='delete[]' value='{$row['id']}' type='checkbox'>"; mysql_connect("localhost", "root", "root") or die(mysql_error()); mysql_select_db("db1") or die(mysql_error()); $query2 = "SELECT * FROM admin"; $result2 = mysql_query($query2) or die(mysql_error()); print "<form name='namestoupdate' method='post' action='update.php'>\n"; print '<select>'; while($row2 = mysql_fetch_array($result2)) { if ($row2['priv']==prov){print '<option value="'.$row2['user'].'" name="prov['.$i++.']">'.$row2['user'].'</option>';} } print '</select>'; print "<input type='submit' value='submit' />"; print "</form>"; } ?> Visual aid Hello, Hopefully I can ger som help here I have been googling this for months and seem to cant find anything that will help me out. I am trying to create a form (which is the easy part) but I want this form to send multiple entries at once from what I gather so far I need to use for each and/or loop which i am not familiar with it with my lack of knowledge........ what I have so far is Table= locations fields are id state county city the form is set up as follows state county city city city city city city city city city city city city The reason for so many cities is so i can update all cities in one county at the same time saving time I am not sure if its % doable in the manner i would like it to be done but i hope so ok i enter the state and county then i enter the cities i want i submit the form i want it to create the state/county and the first city with the next id # then enter the state/county and next city and id#. please some help me if u need to see my file let me know and ill post it im just not sure which one you need i believe it will be the save.php file but i also have the create.php file which is the form itself Thanks anyone for the help i can get Hello, For starters I'm not sure if what I want to do is possible, but if it is I would like your input. I have a script that will show a number of fields to fill out in a second form based on the number the user puts into the first from. the problem is that only the last one saves into the database and not all of them. Code: [Select] <form auction="index.php" method="post"> System Name: <input type="text" name="systemname"> Number of E-sites: <input type="text" name="events"> Number of Sigs: <input type="text" name="sigs"><br> <input type="reset" name="reset" value="Reset"> <input type="submit" name="start" value="Start"> </form> <form auction="index.php" method="post"> <?php $events = $_POST['events']; $system = $POST['systemname']; if (isset($_POST['start'])) { $num = $_POST['sigs']; $i = 0; While ($i < $num) { echo "Sig ID: <input type=text name=sigid>"; echo "Type: <input type=text name=type>"; echo "Name: <input type=text name=name>"; echo "Notes: <input type=text name=notes>"; echo "<br>"; $i++; } } ?> <input type="submit" name="enter" value="Enter"> </form> <?php $sigid = $_POST['sigid']; $type = $_POST['type']; $name = $_POST['name']; $notes = $_POST['notes']; mysql_connect('xt', 'x', 'x'); mysql_select_db('wormhole'); if (isset($_POST['enter'])) { $query = "INSERT INTO sites VALUES ('$system','$events','$sigid','$type','$name','$notes')"; mysql_query($query); } ?> How do I get it so all the data saves, lets say that $num = 5, I want all 5 to save not just the last one. Here is one of those purely conceptual questions, which involves no code. I'm trying to create a select query which among other things, allows a user of a website to search other members who fall within a particular age range. I have a column in the table where the members' information are stored which records their ages. Which brings us to the problem. On any given day, a member's age may increase by one year compared to what it was the previous day, hence the need to update this column periodically. I can't think of any way to automatically update this column on a daily basis. So my solution is to run an initial update query every time a member tries to search other members based on age, which updates the age column for all other members, before running the select query which eventually retrieves the desired age range. This leads to the second problem. Imagine there are thousands of users using the website. At any given instance, there could be hundreds of members, trying to search others based on age. This means hundreds of users will be updating a single column (the age column) in one table at the same time. Is this feasible? Can it cause the server to crash? Or is there really a more reasonable way to do all of this? Thank you all for taking your time to read this. Appreciate any responses. MySQL returns an error in the form of a number, a state, and a message. Without parsing the message you will not be able to determine what column is duplicated.While parsing the error code, I have also notice that, if you have multiple unique fields as duplicates, only the first duplicate encountered will be returned in the message. This is not very helpful to the end user.
Is there any way to parse the returned error code to reflect all duplicate fields, please see sample code below?
$error=array(); $sql = 'INSERT INTO staff(username, email, phone) VALUES (?, ?, ?)'; $stmt = $conn->stmt_init(); $stmt = $conn->prepare($sql); // bind parameters and insert the details into the database $stmt->bind_param('sss', $username, $email, $phone); $stmt->execute(); if ($stmt->errno == 1062) { $errors[] = "One of the fields is already in use."; } i am currently developing a voting system for a school project using dreamweaver.. on my vote page, i use checkboxes to select/vote a number of candidates. i want to automatically add/count the total tally and update my database upon submission of votes. since im new to php, all my codes are generated by dreamweaver..and dreamweaver doesn't have a function for handling multiple row update on database. can anyone please help with editing this code to make it work for my system? thanks in advance Code: [Select] <?php require_once('Connections/organizazone_db.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE tbl_candidates SET votecount=%s WHERE user_id=%s", GetSQLValueString(isset($_POST['vote[]']) ? "true" : "", "defined","1","0"), GetSQLValueString($_POST['user[]'], "text")); mysql_select_db($database_organizazone_db, $organizazone_db); $Result1 = mysql_query($updateSQL, $organizazone_db) or die(mysql_error()); } mysql_select_db($database_organizazone_db, $organizazone_db); $query_rs_candi = "SELECT * FROM tbl_candidates"; $rs_candi = mysql_query($query_rs_candi, $organizazone_db) or die(mysql_error()); $row_rs_candi = mysql_fetch_assoc($rs_candi); $totalRows_rs_candi = mysql_num_rows($rs_candi); $query_rs_candi = "SELECT * FROM tbl_candidates"; $rs_candi = mysql_query($query_rs_candi, $organizazone_db) or die(mysql_error()); $row_rs_candi = mysql_fetch_assoc($rs_candi); $totalRows_rs_candi = mysql_num_rows($rs_candi); ?> <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>"> <table border="1"> <tr> <td> </td> <td>user_id</td> <td>votecount</td> </tr> <?php do { ?> <tr> <td><input name="vote[]" type="checkbox" id="vote[]" value="1" /> <label for="vote[]"></label></td> <td><label for="user[]"></label> <input name="user[]" type="text" id="user[]" value="<?php echo $row_rs_candi['user_id']; ?>" /></td> <td><?php echo $row_rs_candi['votecount']; ?></td> </tr> <?php } while ($row_rs_candi = mysql_fetch_assoc($rs_candi)); ?> </table> <br /> <br /> <input type="submit" name="submit" id="submit" value="Submit" /> <input type="hidden" name="MM_update" value="form1" /> </form> <?php mysql_free_result($rs_candi); ?> Hi All!! I am a little confused. I have a form where I want around 15 different checkboxes, all or some of these can be checked. When the form is sent I insert the fields into a database. I am wondering how I can have only the fields checked saved into the database, without having to have a row for each field. Thanks Chris I have encountered a brick wall trying to use checkboxes. I am attempting to create a small form where I can record if a customer's item has been sent. The way I intend it to work is that the name and ID of the customer (stored in the 'customer' table) are retrieved through a query and displayed in two columns. In the third column is a checkbox beside the name and ID of each customer which, when ticked, sends a value to a second table called 'sentorders' for that particular person. As I am just trying to understand the basics of this for now, a list of all customers will be shown for the time being. The default value of the checkbox needs to be 'No' and if the checkbox is ticked the value should become 'Yes'. When a checkbox is ticked, the customer name, ID and current date are sent to the 'sentorders' table. Only if the box is ticked will the details be stored in the table. The problem I having is how do I set up the checkbox to work as described above. I have had a look at other questions online, but don't understand how it works. Any help would be appreciated. My current code is as follows. <?php $query = mysqli_query ($connect, "SELECT name, id FROM customer"); // Create Table echo '<table align="left"> <tr> <td align="left"><b>Name</b></td> <td align="left"><b>ID</b></td> <td align="left"><b>Order Sent</b></td> </tr>'; // Show Name/ID while ($row = mysqli_fetch_array($query)) { echo '<tr><form action="order_sent.php" method="post"><td align="left"> <td align="left">' . $row['name'] . '</a></td> <td align="left">' . $row['id'] . '</td> <input type="checkbox" name="order[];" value=''></tr>'; } echo '</table><p align="left"><input type="submit" name="enter" value="Update"/><input type="hidden" name="enter" value="TRUE" /></form>'; } ?> hello. can (or rather how can) i put multiple checkboxes in to 1 db column? so, can i do this in 1 table: id - tick box id 1 - 1,2,3 2 - 4,5,6 3 - 7,8,9 and then relate that table to another table tick box id - name 1 - name1 2 - name2 3 - name3 etc.. if so, what format would i use in the db? varchar, enum or set (1,2,3 or '1','2','3') and how would i echo them out with the names from the second table? thanks Hi all, iv been trying to compile a script that will allow users to select multiple checkboxs that will filter results from db..but to no avail. I have my data stored in mysql and have the queries saved seperatley. i.e. price = 0-500, 500-1000.etc. What im trying to achieve is to allow users to select a checkbox that will execute that particular query and also more importantly allow them to select 'multiple' checkboxes that will filter the results accordingly. I have never attempted to code this before although I am aware that it might involve arrays. If someone could give me a nudge in the right direction that would be great :-) hello all, im wondering if it is possible to have multiple check boxes that get created based on the number of rows in a table (one representing each row) Code: [Select] <input type='checkbox' name='approve[$tid]' value='ON'> and then have a submit button at the bottom of the page that will find all of the checkboxes (it could be 1, or 100) and submit it to my form handling page. thanks Hey All, I tried seraching, but I'm not sure what exactly to search for. Here's what I need to do, and any push in the right direction would be great: I have a PHP form, with the Following: Text Box: Student ID Checkboxes for Activities What I need to do is somehow loop through and make a new row for each activity. Example, if I entered Student ID 105 and Activities are Basketball, Baseball, and Chess Team, I need three different rows in the database each listing the individual activity and the student ID. Any suggestions? I know how to do this if it was one entry (radio buttons) but want to be able to enter multiple rows at a time. Thanks! |