PHP - Store Multiple Selection From Pagination Info Into Single Array
Hi
I have a results page from a MySQL query and I have implemented pagination to present data in chunks of 25 per page in a table view (each row => 1 entry). My problem is that next to each data row, I have a selection checkbox, and if the user clicks on it, he can download the selected entries. This thing worked OK before I employed paginated view, when I presented all data in one page. Now, if I select e.g. 2 entries in page 1, then I jump to page 12 and select another 2 entries, if I click on the "Retrieve" button, I get only the last 2 entries (from the last page visited). How can I solve this problem? With JS? Can I use PHP only? Similar TutorialsHello, I am trying to update my database with multiple array values like this. if (isset($_POST['submit_multiple'])) { $id=$_POST['selector']; $class=$_POST['class']; $section=$_POST['section']; $N = count($id); for($i=0;$i<$N;$i++) { echo "update table1 set transfer_status='yes',transfer_date='".date('Y-m-d')."',class='".$class[$i]."',section='".$section[$i]."' where enroll_no='".$id[$i]."'"; }and in the form <form action="transfer_mul_student.php" method="post"><select name="class[]"> <option value="">--SELECT CLASS--</option> <option value="Nursery">Nursery</option> <option value="LKG">LKG</option> <option value="UKG">UKG</option> <option value="I">I</option> <option value="II">II</option> <option value="III">III</option> <option value="IV">IV</option> </select> <select name="section[]"><option value="">--SELECT SECTION--</option> <option value="A">A</option> <option value="B">B</option> <option value="C">C</option> </select><input name="selector[]" id="selector" type="checkbox" value="<?php echo $row['enroll_no']; ?>" /> <input type="submit" class="delete_multiple" value="Transer" name="submit_multiple" />Here $row['enroll_no']is from table student. I have attached the screenshot for the page display with form err1.PNG 12.04KB 0 downloads, In that If i select checkbox1, checkbox2 checkbox3.. it takes the value for class and section properly, but if i select checkbox1, checkbox3, it takes value for 1st record properly and for 2nd one it takes blank value for class and section. How to overcome this? Please suggest I am having a problem applying pagination to my page when I only have one record displayed. I would like to have it set up to where one record is followed by the next one in the list. I have tried several ways but they are for whole tables moving to the next page. I think I am missing something small but not sure. Any help will be greatly appreciated, thanks. Hi, thanks for reading this! I need some help with my pagination, maybe the answer is very simple but I've tried a lot of coding including work with tables but it didn't work It's about my page (in Dutch) where I show images of collections. A page looks like this: http://www.verzamelaars.net/mobach/index.php Now I want the name of the collector under the image, but every time I get this: http://www.verzamelaars.net/mobach/index2.php The code I use now is: <?php while($row = mysql_fetch_array($result)) { echo "<table><tr><td><a href='{$row['mijnlink']}'><img src={$row['thumb']} hspace=1 vspace=4></a></td></tr>"; echo "<tr><td><a href='{$row['verzamelaarlink']}'>{$row['verzamelaar']}</a></td></tr></table>"; } ?> I've been playing with the table but so far no good, hope you can help me with this! Kind regards, Arjen van Dorsten Hello, I have a variable called $Price, We are getting it through Mysql Database using While loop. We getting the data from database in ordered by ID. Now then i have requirement to store that data into Low to High form ... Like we are receiving $price lke unordered form .. 50 14 35 25 00 145 52 Here i just want to store it in Low to high form like 00, 14,25,35 ... and so on .. Please suggest me the appropriate code. While($myrow=mysql_fetch_array($result, MYSQL_ASSOC)) { some codes return value $price. // want to store in array } $array($price) // here want to store in Low to high with key value. hi i am trying to make a payroll calculator script that takes employee info, calculates pay, displays submitted info in a table, stores info in an array, and updates the array when new info is submitted. i have most of these accomplished, i am having trouble with the "store into an array, and update the array when new info is submitted" parts of the project. i am still not very fluent in php so there may be easier ways to achieve what i have so far. any pointers would be a great help, this part has got me stumped. Hi Guys, I need help for in storing data from PHP from array in mysql. I'm very new to PHP/Mysql and have started learing it just few weeks back. I'm tryting to build a website for myself. I'm having tough time trying to insert the data from Form in mysql. I have a form where user update the company name and insert there product name with there image. I want to rename the image with the corresponding text field value and insert the upload path in the table. my FORM Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> body,td,th { color: #000; font-family: Tahoma, Geneva, sans-serif; font-size: 80%; } body { background-color: #9CF; } table { background: #CCF; } th { font: bold normal 16px/normal "Times New Roman", Times, serif; text-transform: capitalize; color: #00F; background: #FFC; } td { font: bold 14px Georgia, "Times New Roman", Times, serif; text-transform: capitalize; color: #3A00FF; background: #FF9; } </style> </head> <body> <form action="upload-file1.php" method="post" enctype="multipart/form-data" name="form"> <strong>Company Name:</strong> <input name="product" type="text" /> <br /> <table> <tr bgcolor="#FF9900"> <th colspan="3" bgcolor="#CCFFFF">filter </th> <th colspan="5" bgcolor="#CCFFFF">heater</th> </tr> <tr><td>filter1</td><td><input name="filter[]" type="text" id="filter"/> <td><input name="img_filter[]" type="file" /></td><td>heater1: </td> <td><input name="heater[]" type="text" id="heater"/></td> <td><input name="img_heater[]" type="file" /></td> </tr> <tr><td>filter2</td><td><input name="filter[]" type="text" id="filter"/> <td><input name="img_filter[]" type="file" /></td><td>heater2: </td> <td><input name="heater[]" type="text" id="heater"/></td> <td><input name="img_heater[]" type="file" /></td> </tr> <tr><td>filter3</td><td><input name="filter[]" type="text" id="filter"/> <td><input name="img_filter[]" type="file" /></td><td>heater3: </td> <td><input name="heater[]" type="text" id="heater"/></td> <td><input name="img_heater[]" type="file" /></td> </tr> <tr><td>filter4</td><td><input name="filter[]" type="text" id="filter"/> <td><input name="img_filter[]" type="file" /></td><td>heater4: </td> <td><input name="heater[]" type="text" id="heater"/></td> <td><input name="img_heater[]" type="file" /></td> </tr> <tr><td>filter5</td><td><input name="filter[]" type="text" id="filter"/> <td><input name="img_filter[]" type="file" /></td><td>heater5: </td> <td><input name="heater[]" type="text" id="heater"/></td> <td><input name="img_heater[]" type="file" /></td> </tr> </table> <br /> <br /> <input name="submit" type="submit" value="submit" /> </form> </body> </html> my PHP Code Code: [Select] <?php require("connect.php"); ?> <?php $product = $_POST['product']; echo $product; if(isset($_POST["submit"])){ $sql = "INSERT INTO company (product) VALUES ('$product')"; $query = mysql_query($sql) OR DIE(mysql_error()); $comp_id = mysql_insert_id(); echo $sql; } ?> <?php function filter() { if(isset($_POST['submit'])) { foreach($_POST['filter'] as $key => $val) { if(trim($val) != '') $filter[] = $val; } $total_records_filter = count($filter); for($i = 0; $i < $total_records_filter; $i++) { $prod_val = $filter[$i]; $sql_prod = "INSERT INTO filter(filter_id, filter) VALUES('', '$prod_val')"; echo $sql_prod.'<br>'; mysql_query($sql_prod) OR die(mysql_error()); } } } filter(); function heater() { if(isset($_POST['submit'])) { foreach($_POST['heater'] as $key => $val) { if(trim($val) != '') $heater[] = $val; } $total_records_heater = count($heater); for($i = 0; $i < $total_records_heater; $i++) { $dir_val = $heater[$i]; $sql_dir = "INSERT INTO heater(heater_id, heater) VALUES('', '$dir_val')"; echo $sql_dir.'<br>'; mysql_query($sql_dir) OR die(mysql_error()); } } } heater(); ?> <?php mysql_close($link)?> My Table structure company comp_id int(5) PK product varchar(50) No filter filter_id int(5) PK filter varchar(25) No filter_path varchar(100) No heater heater_id int(5) PK heater varchar(25) No heater_path varchar(100) No company_filter id int(5) PK comp_id int(5) PK FK (From company table) filter_id int(5) PK FK (From filter table) company_heater id int(5) PK comp_id int(5) PK FK (From company table) heater_id int(5) PK FK (From heater table) Regards BW Hi all, I will wish to modify this code to get a choice of multiple selection, so I can select multiple category and not a single as it is currently. Here is the original code: Code: [Select] {if $step==1} <div class="form_content"> <form name="newad" method="post" action="newad.php?step=1"> <label>{$lng.listings.category}<span class="mandatory"> *</span></label> <select id="category" name="category"> <option value="">{$lng.listings.category}</option> {foreach from=$categories item=v name=cat} {if $v.parent==1} <optgroup label="{$v.str}{$v.name}"> {else} <option value="{$v.id}" {if $tmp.category==$v.id}selected="selected"{/if}>{$v.str}{$v.name|escape:"html"}</option> {if ( $smarty.foreach.cat.index!=$categories|@count-1 && $v.parent_id!=$categories[$smarty.foreach.cat.iteration].parent_id) || ($smarty.foreach.cat.index==($categories|@count-1) && $v.parent_id!=0)} </optgroup> {/if} {/if} {/foreach} </select> {* ----------------------- levels drop down categories --------------------- *} {* <div> <select id="category1" name="category1" class="levels" onChange="chooseCateg(this.form, 1)"> <option value="">{$lng.listings.category}</option> {foreach from=$categories item=v name=cat} {if $v.parent_id==0} <option value="{$v.id}">{$v.name|escape:"html"}</option> {/if} {/foreach} </select> </div> <div style="display: none;" id="level2"> <select id="category2" name="category2" class="levels" onChange="chooseCateg(this.form, 2)"> </select> </div> <div style="display: none;" id="level3"> <select id="category3" name="category3" class="levels" onChange="chooseCateg(this.form, 3)"> </select> </div> <div style="display: none;" id="level4"> <select id="category4" name="category4" class="levels" onChange="chooseCateg(this.form, 4)"> </select> </div> <div style="display: none;" id="level5"> <select id="category5" name="category5" class="levels" onChange="chooseCateg(this.form, 5)"> </select> <input type="hidden" name="category" id="category" /> </div> *} <br/><br/> <div class="buttons"><strong><input type="submit" name="Choose_categ" id="Choose_categ" value="{$lng.listings.next_step}" /></strong></div> <div class="clearfix"></div> </form> </div> </div> {* end form_container *} {/if} {* end step1 *} Thank you for your help When I try to select more than one value for my report, only one value shows. I tried a few things, but I'm not having any luck. Here is the form code: Code: [Select] <td style="text-align: right">Job Type:</td> <td> <select name="job_type" multiple="multiple" size="3"> <option value="0" selected>ALL</option> {section name=jt loop=$job_type_list} <option value="{$job_type_list[jt][0]}">{$job_type_list[jt][1]}</option> {/section} </select> </td> Here is the other code: //All IIS Object Code is to be encapsulated in the execute_object function function execute_object($tab){ if ((isset($_POST['job']) and isset($_POST['job_type']) and isset($_POST['child_type']) and isset($_POST['job_status']) and isset($_POST['child_status']) and isset($_POST['ou']) and isset($_POST['child_ou']) and isset($_POST['pm']) and isset($_POST['child_pm']) and isset($_POST['dm']) and isset($_POST['child_dm']) and isset($_POST['customer']) and isset($_POST['end_date'])) or (isset($_SESSION['report_job']) and isset($_SESSION['report_job_type']) and isset($_SESSION['report_child_type']) and isset($_SESSION['report_job_status']) and isset($_SESSION['report_child_status']) and isset($_SESSION['report_ou']) and isset($_SESSION['report_child_ou']) and isset($_SESSION['report_pm']) and isset($_SESSION['report_child_pm']) and isset($_SESSION['report_dm']) and isset($_SESSION['report_child_dm']) and isset($_SESSION['report_customer']) and isset($_SESSION['report_end_date']))) { //Include functions include $GLOBALS['include_path']."penta.job.functions.php"; include $GLOBALS['include_path']."display.functions.php"; include $GLOBALS['include_path']."report.functions.php"; //Get report parameters if (isset($_POST['job'])){ $job_id = $_POST['job']; } else { $job_id = $_SESSION['report_job']; } if (isset($_POST['job_type'])){ $job_type = $_POST['job_type']; } else { $job_type= $_SESSION['report_job_type']; } if (isset($_POST['child_type'])){ $child_type = $_POST['child_type']; } else { $child_type= $_SESSION['report_child_type']; } if (isset($_POST['exclude_type'])){ $exclude_type = 1; } else { if(isset($_SESSION['report_exclude_type'])){ $exclude_type = $_SESSION['report_exclude_type']; } else { $exclude_type = 0; } } if (isset($_POST['job_status'])){ $job_status = $_POST['job_status']; } else { $job_status= $_SESSION['report_job_status']; } if (isset($_POST['child_status'])){ $child_status = $_POST['child_status']; } else { $child_status= $_SESSION['report_child_status']; } if (isset($_POST['ou'])){ $ou_id = $_POST['ou']; } else { $ou_id = $_SESSION['report_ou']; } if (isset($_POST['child_ou'])){ $child_ou_id = $_POST['child_ou']; } else { $child_ou_id = $_SESSION['report_child_ou']; } if (isset($_POST['pm'])){ $pm_id = $_POST['pm']; } else { $pm_id = $_SESSION['report_pm']; } if (isset($_POST['child_pm'])){ $child_pm_id = $_POST['child_pm']; } else { $child_pm_id = $_SESSION['report_child_pm']; } if (isset($_POST['dm'])){ $dm_id = $_POST['dm']; } else { $dm_id = $_SESSION['report_dm']; } if (isset($_POST['child_dm'])){ $child_dm_id = $_POST['child_dm']; } else { $child_dm_id = $_SESSION['report_child_dm']; } if (isset($_POST['customer'])){ $cus_id = $_POST['customer']; } else { $cus_id = $_SESSION['report_customer']; } if (isset($_POST['sort_by_cust'])){ $sort_by_cust = 1; } else { if(isset($_SESSION['report_sort_by_cust'])){ $sort_by_cust = $_SESSION['report_sort_by_cust']; } else { $sort_by_cust = 0; } } if (isset($_POST['end_date'])){ $edate = $_POST['end_date']; } else { $edate = $_SESSION['report_end_date']; } $job_type = implode(",",$_POST['job_type']); //Prepare to output report $filename = "Project Review Report.xls"; if (isset($_POST['print'])){ //Prepare the output file header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=\"$filename\""); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); header("Pragma: public"); } else { //Save the report parameters to enable printing from the preview $_SESSION['report_job'] = $job_id; $_SESSION['report_job_type'] = $job_type; $_SESSION['report_child_type'] = $child_type; $_SESSION['report_exclude_type'] = $exclude_type; $_SESSION['report_job_status'] = $job_status; $_SESSION['report_child_status'] = $child_status; $_SESSION['report_ou'] = $ou_id; $_SESSION['report_child_ou'] = $child_ou_id; $_SESSION['report_pm'] = $pm_id; $_SESSION['report_child_pm'] = $child_pm_id; $_SESSION['report_dm'] = $dm_id; $_SESSION['report_child_dm'] = $child_dm_id; $_SESSION['report_customer'] = $cus_id; $_SESSION['report_sort_by_cust'] = $sort_by_cust; $_SESSION['report_end_date'] = $edate; //Output a print button at the start of the preview preview_print_button("load_object.php?&object=52.2"); } //Get the list of jobs based on the given criteria $job_list = report_job_list($job_id, $job_type, $child_type, $exclude_type, $job_status, $child_status, $ou_id, $child_ou_id, $pm_id, $child_pm_id, $dm_id, $child_dm_id, $cus_id, $sort_by_cust, $selected_by); //Set the max script execution time to ensure it can finish based on the number of jobs $num_jobs = $job_list->RecordCount(); set_time_limit(60 + ($num_jobs * 30)); //Parse the template $template = $GLOBALS['reports_path']."report52.2.htm"; $default_logo = "report52.2_files/image001.gif"; $hdr = null; $ftr = null; parse_template($template, $default_logo, $hdr, $ftr); I am retrieving values in form of array from a database table and out of the I have to build multidimensional array depending upon the parent->child relationship in the same array. The result is as => Array ( => Array ( [label] => Shirt [uri] => # ) [1] => Array ( [label] => Jeans [uri] => # ) [2] => Array ( [label] => Lowers [uri] => # ) [3] => Array ( [label] => T-Shirts [uri] => # ) [4] => Array ( [label] => cotton shirt [uri] => # ) [5] => Array ( [label] => Trousers [uri] => # ) ) each is related to some parent-id. Can any body me any idea. if a user were to select multiple items in a selection list I would like to concatenate those items into a list and assign that into a variable. I know I should loop through the list but i'm not sure how I would continue to add those values to a variable. Hello all, I have an error handler that I need to append messages to (First name not right, Last name not right, etc) I'm using a session array to handle all error messages titled GORB. How come this code won't work? $_SESSION['GORB']['message'][] = "First name wrong"; $_SESSION['GORB']['message'][] = "Last name wrong"; How can I get it to work? I already have the handler output written and functioning fine, I just need to get it to loop over an array of errors instead of just one. hello, im using the php mailer, working nicely but I need to put 3 values in my from fields in subject, now I have just 1 field $mail2->Subject = ($_POST['name']); I need to include in the subject email, commas and a message, I tried the following, but not working (noob learning!) $mail2->Subject = ($_POST['name'] "," $_POST['email'] "," "confirmation mail" ); thank you so much! I can use the first while loop, but there is no data in the second while loop. Is there a better way as I have never done this before... Code: [Select] <?php $featured_results = mysql_query("SELECT * FROM products LEFT JOIN product_images ON products.product_id=product_images.product_id WHERE products.product_featured='1' AND products.product_active='1' AND thumb='1'"); $fa=0; while($featured_row = mysql_fetch_assoc($featured_results)) { $fthumb_result = mysql_query("SELECT image_name FROM product_images WHERE product_id='".$featured_row['product_id']."' AND thumb='1'"); $fthumb = mysql_fetch_row($fthumb_result); if ($fa==0) { echo "\n<img id=\"home-slider-photo-".$fa."\" class=\"home-slider-photo preload\" src=\"/includes/getimage.php?img=".$fthumb[0]."&w=370&h=370\" alt=\"\" />"; } else { echo "\n<img id=\"home-slider-photo-".$fa."\" class=\"home-slider-photo preload home-slider-photo-unsel\" src=\"/includes/getimage.php?img=".$fthumb[0]."&w=370&h=370\" alt=\"\" />"; } $fa++; } echo "<div id=\"home-slider-photo-price\">"; $fb=0; while($featured_row2 = mysql_fetch_assoc($featured_results)) { if ($fb==0) { echo "\n<div id=\"home-slider-photo-price-".$fb."\" class=\"home-slider-photo-price\">\n<span>only</span>$".$featured_row2['product_price']."\n</div>"; } else { echo "\n<div id=\"home-slider-photo-price-".$fb."\" class=\"home-slider-photo-price home-slider-photo-price-unsel\">\n<span>only</span>$".$featured_row2['product_price']."\n</div>"; } $fb++; } echo "</div>"; ?> hey i am using a MySql database and i need to create a dynamic HTML table with one of its columns as checkboxes.so i have to create multiple checkboxes.but these checkbox values are to be stored in a mysql table and then later retrieved when form reloads.and depending on previous state when form was submitted, the newly created checkboxes have to be checked in the same manner.so how do i store multiple checkbox values in my table and also how do i retrieve them? please help. Quote
I have this code here. i wanted to know how i can be able to make multiple selections from the returned data from the database and how to save them Quote
<select name="troom" multiple class="form-control" required> <option selected="true" disabled="disabled">--Select a room--</option> $records =mysqli_query($con, "select * from room where TRoom not in (select TRoom from roombook where cin <= '$checkout' and cout >= '$checkin');"); while ($data = mysqli_fetch_array($records)) { echo "<option value='" . $data['TRoom'] . "'>" . $data['TRoom'] . "</option>"; //displaying data in option menu } } ?> </select>
Hi, I m trying to add items from a master list to each sub process. But, I failed to proceed on what i intend to do. 1) i need to select an process from the combo box. 2) from the master list, i hv to check the item which belong to the process. 3) upon submitting, save into database. 4) the it will show those are already checked or unchecked. here is the codes i hv done: Code: [Select] <?php require_once '../../connectDB.php'; require_once '../include/paginator.class.php'; $sql="SELECT * FROM tb_item"; $result = mysql_query($sql) or die(mysql_error()); $pages = new Paginator; $pages->items_total = mysql_num_rows($result); $pages->mid_range = 5; $pages->items_per_page = 100; $pages->paginate(); $sql="SELECT * FROM tb_item ORDER BY itm_tcpd ASC $pages->limit"; $result = mysql_query($sql) or die(mysql_error()); function createComboBox() { $sql = "SELECT tb_process.pro_name, tb_process.pro_id, tb_sub_process.sub_id, tb_sub_process.sub_name FROM tb_process INNER JOIN tb_sub_process ON tb_process.pro_id = tb_sub_process.pro_id ORDER BY pro_name"; $result = mysql_query($sql) or die('Cannot get Process. ' . mysql_error()); $group = array(); while ($row = mysql_fetch_assoc($result)) { $group[$row['pro_name']][] = $row; } echo "<table> <tr> <td>Add item into :</td> <td> <select name='cboSub' id='cboSub'> <option value='0' selected='selected'>----- Selection -----</option>"; foreach ($group as $key => $values) { echo " <optgroup label='$key'>"; foreach ($values as $value) { $select = ($id == $value['sub_id']) ? 'selected="selected"' : NULL; echo '<option value="'.$value['sub_id'].'"'.$select.'>'.$value['sub_name'].'</option>'; } echo " </optgroup>"; } echo " </select> </td> </tr> </table>"; } if(isset($_POST['add'])) { $id = $_POST['checkbox']; foreach($id as $key=>$val) { $sql = "INSERT INTO tb_record (rec_tpcd, sub_id) VALUES ('$key', '$sub_id')"; $result = mysql_query($sql); } echo(" <SCRIPT LANGUAGE='JavaScript'> window.alert('Items has been added into the database.'); window.location='addItem.php'; </SCRIPT>"); } ?> <!DOCTYPE div PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript"> $().ready(function() { $("#cboSub").change("get_tpcd.php", { }); }); </script> </head> <body> <div> <table width="100%"> <tr> <td width="65%"><?php createComboBox(); ?></td> <td width="30%"><?php echo $pages->display_pages(); ?></td> <td width="5%"><?php echo $pages->display_jump_menu(); ?></td> </tr> </table> </div> <div> <form method='post' action=''> <table width='100%' border='1' align='left' cellpadding='5' cellspacing='1'> <tr> <?php $numCol = 5; $count = 0; for($i=0; $i<$numCol; $i++) { echo "<th align='center'>TPCD No.</th> <th align='center'>Check / Uncheck</th>"; } while ($row = mysql_fetch_array($result)) { extract($row); if($count % $numCol == 0) { echo '</tr><tr>'; } echo " <td align='center'>".$itm_tcpd."</td> <td align='right'><input type='checkbox' name='checkbox[".$itm_tcpd."]' id='checkbox' ".$checked."></td>"; $count++; } ?> </tr> <tr> <td colspan='10' align='right'> <input type='submit' name='add' id='add' value='Add TPCD'> </td> </tr> </table> </form> </div> </body> </html> the output is something similar as in the attachment. any helps are vy welcome and appreciated. regards, juz [attachment deleted by admin] i'm trying to get all the results from a query search into an array and them have another query search the results from that array againts a different table to get the right results. Here is my code: Code: [Select] $name = $_GET['name']; //lets say $name = 'california' $get_state = mysql_query("SELECT * FROM locations WHERE state LIKE '$name'") or die(mysql_error()); $num_states = mysql_num_rows($get_state); $location_array = array(); $i = 0; while($state = mysql_fetch_assoc($get_state)){ $location_array[$i][] = $state['id']; $i++; } $get_buildings = mysql_query("SELECT * FROM points WHERE location_id='".implode(",", $location_array)."' ORDER BY name ASC") or die(mysql_error()); However i can't get any results. I tried outputing the array by imploding it and all i got was "array, array, array, array," I hope someone here can help me out. hello, um i got a form that stored an array of variables upon users clicks. it submits to another page fine as an array and i can print them using if(!empty($_POST['langSpoken'])) { echo "\n<p><strong>You selected the following LangSpoken:</strong></p>\n<ul>"; foreach($langSpoken as $lang) { // exclude any items with chars we don't want, just in case someone is playing if(!preg_match('/^[-A-Z0-9\., ]+$/iD', $lang)) continue; // print the lang echo "\n\t<li>" . htmlspecialchars($lang) . "</li>"; } echo "\n</ul>"; } else { echo "\n<p>No items selected</p>"; } it prints a list a of array like english spanish but i need to store each one in one variable so i can store in a database is there a way? thanks I want to store... - questionID - questionNo - questionText ...in one array? How do I do that?! Debbie |