PHP - Function To Implode Array And Insert Record
Not sure if this is right. I can't get it to insert my record. Can someone please tell me if I'm doing it right?
cus_functions.php
function dbRowInsert($table_name, $form_data) { global $conn; $fields = array_keys($form_data); $sql = "INSERT INTO ".$table_name." (`".implode('`,`', $fields)."`) VALUES('".implode("','", $form_data)."')"; return mysqli_query($sql); }process.php include("new_db.php"); include("cus_functions.php"); $do=$_GET['do']; if($do=='addpro'){ if(isset($_POST['submit'])){ $input = $_POST['title']; $comp = '0'; $form_data = array('title' => $input, 'completed' => $comp); dbRowInsert('projects', $form_data); }} Similar TutorialsCan anyone help me complete this script I can get it working with using an implode function, but for the purpose of knowledge I want to not use it. I just want it to echo back the corresponding checkboxes, but I can't get the echoing correct, it echoes back array not the value? Code: [Select] <html> <title>What do you want on your Tombstone?</title> <body> <?php $Output_form = true; if (isset($_POST['submit'])) { if (empty($_POST['toppings'])) { echo '<b>You forgot the toppings for your Tombstone.</b>'; echo '<br>'; echo '<br>'; } else { echo '<p><b>This is what you are getting on your Tombstone: '; (array)$_POST['toppings']; echo $toppings; echo '!'; echo '</p></b>'; $Output_form = false; } } if ($Output_form) { ?> <form action="ProcessToppings.php" method="post"> <p><i><h2>What do you want on your Tombstone?</h2></i></p> <p> <input type="checkbox" name="toppings[]" value="pepperoni" /> Pepperoni<br /> <input type="checkbox" name="toppings[]" value="sausage" /> Sausage<br /> <input type="checkbox" name="toppings[]" value="mushrooms" /> Mushrooms<br /> <input type="checkbox" name="toppings[]" value="cheese" /> Cheese<br /> <input type="checkbox" name="toppings[]" value="olives" /> Olives</p> <p> <input type="submit" value="Make that Peet-Za!" name="submit" /></p> </form> <?php } ?> </body> </html> This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=319071.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=308349.0 I get this error on my homepage : Warning: implode() [function.implode]: Invalid arguments passed in /home/shqip1/peqini.com/wp-content/themes/sportpress/functions/wpzoom-widgets.php on line 1469 This is the code to modify http://pastebin.com/RiBsyG3c Thanks I am using a PHP class (it is attached) for Google Analytics that I got from this link below: http://www.acleon.co.uk/?p=173 Unfortunately, it appears the Class has a PHP error: Warning: implode() [function.implode]: Invalid arguments passed in Galvanize.php on line 114 and line 181. This is line 114: setcookie('__utmc', implode('.', $this->UTMC), 0, $this->CookiePath, $this->getDomain()); Here is line 181: $urchinUrl .= '&utmcc=__utma%3D'.implode('.', $this->UTMA).'%3B%2B__utmz%3D'.implode('.', $this->UTMZ).'%3B'; I did not see UTMC and UTMZ declared anywhere in the Class. The class file is attached. Thanks for your help in advance. I am getting this error in the header.php of my wordpress theme... Can anyone help? Thanks! Warning: implode() [function.implode]: Invalid arguments passed in /home/bexxx/public_html/wp-content/themes/organic_portfolio_gray/header.php on line 74 <!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" <?php language_attributes(); ?>> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <meta name="distribution" content="global" /> <meta name="robots" content="follow, all" /> <meta name="language" content="en" /> <title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title> <link rel="Shortcut Icon" href="<?php echo bloginfo('template_url'); ?>/images/favicon.ico" type="image/x-icon" /> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_enqueue_script("jquery"); ?> <?php wp_head(); ?> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/superfish/superfish.js"></script> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/superfish/hoverIntent.js"></script> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.flow.1.1.js"></script> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/iepngfix_tilebg.js"></script> <!--IE6 Fix--> <style type="text/css"> img, div, a, input, body, span { behavior: url(<?php bloginfo('template_url'); ?>/images/iepngfix.htc); } </style> <script type="text/javascript"> var $j = jQuery.noConflict(); $j(function() { $j("div#controller").jFlow({ slides: "#slides", width: "960px", height: "480px", timer: <?php echo ot_option('slider_interval'); ?>, duration: 400 }); }); </script> <script type="text/javascript"> $j(document).ready(function() { $j('ul.ot-menu').superfish(); }); </script> </head> <body> <div id="wrap"> <div id="header"> <div class="headercenter"> <p id="title"><a href="<?php echo get_option('home'); ?>/" title="Home"><?php bloginfo('name'); ?></a></p> </div> </div> <div id="navbar"> <div id="nav"> <div id="navbarleft"> <ul class="ot-menu"><li<?php if (is_home()) { echo " class=\"current_page_item\""; }?>><a href="<?php echo get_settings('home'); ?>"><?php _e("Home", 'organicthemes'); ?></a></li> <?php $include_categories = ot_option('include_categories'); ?> <?php wp_list_categories('depth=4&title_li=&sort_column=menu_order&include='.implode(',', $include_categories)); ?></ul> </div> <div id="navbarright"> <ul class="ot-menu"> <?php $include_pages = ot_option('include_pages'); ?> <?php wp_list_pages('title_li=&sort_column=menu_order&include='.implode(',', $include_pages)); ?> </ul> </div> </div> </div> <div style="clear:both;"></div> My error is 'Warning: implode() [function.implode]: Invalid arguments passed in /home/definiti/public_html/contact.php on line 73' Im not sure how to fix this error, as I looked online and it says that my implode() has the right layout too it.. Line 73 in my code (I took the HTML code out) is this line; Code: [Select] $message = implode("<br>\n", $messages); My whole code is; Code: [Select] <?php # PHP Copyright 2007, Thomas Boutell and Boutell.Com, Inc. # Edited by Definition Designs. $recipient = 'defenitiondesigns@googlemail.com'; $serverName = 'www.definition-designs.co.uk'; if ($_POST['send']) { sendMail(); } elseif (($_POST['cancel']) || ($_POST['continue'])) { redirect(); } else { displayForm(false); } function displayForm($messages) { global $login; $escapedEmail = htmlspecialchars($_POST['email']); $escapedRealName = htmlspecialchars($_POST['realname']); $escapedSubject = htmlspecialchars($_POST['subject']); $escapedBody = htmlspecialchars($_POST['body']); $returnUrl = $_POST['returnurl']; if (!strlen($returnUrl)) { $returnUrl = $_SERVER['HTTP_REFERER']; if (!strlen($returnUrl)) { $returnUrl = '/'; } } $escapedReturnUrl = htmlspecialchars($returnUrl); ?> <?php if (count($messages) > 0) { $message = implode("<br>\n", $messages); echo("<h4>$message</h4>\n"); } ?> <form method="POST" action="<?php echo $_SERVER['DOCUMENT_URL']?>"> <p> <b>Your</b> Email Address <input name="email" size="35" maxlength="35" value="<?php echo $escapedEmail?>"/> </p> <p> Your <b>Real</b> Name <input name="realname" size="35" maxlength="35" value="<?php echo $escapedRealName?>"/> </p> <p> Subject Of Your Message <input name="subject" size="35" maxlength="35" value="<?php echo $escapedSubject?>"/> </p> <p> <i>Please enter the text of your message in the field that follows.</i> </p> <textarea name="body" rows="10" cols="60"><?php echo $escapedBody?></textarea> <p> <input type="submit" name="send" value="Send Your Message"/> <input type="submit" name="cancel" value="Cancel - Never Mind"/> </p> <input type="hidden" name="returnurl" value="<?php echo $escapedReturnUrl?>"/> </form> <?php } function redirect() { global $serverName; $returnUrl = $_POST['returnurl']; $prefix = "http://$serverName/"; if (!beginsWith($returnUrl, $prefix)) { $returnUrl = "http://$serverName/"; } header("Location: $returnUrl"); } function beginsWith($s, $prefix) { return (substr($s, 0, strlen($prefix)) === $prefix); } function sendMail() { global $recipient; $messages = array(); $email = $_POST['email']; if (!preg_match("/^[\w\+\-\.\~]+\@[\-\w\.\!]+$/", $email)) { $messages[] = "That is not a valid email address. In format: You@something.com"; } $realName = $_POST['realname']; if (!preg_match("/^[\w\ \+\-\'\"]+$/", $realName)) { $messages[] = "The real name field must contain only alphanumeric characters, spaces and + or - signs."; } $subject = $_POST['subject']; if (preg_match('/^\s*$/', $subject)) { $messages[] = "Please specify a subject for your message. "; } $body = $_POST['body']; if (preg_match('/^\s*$/', $body)) { $messages[] = "Your message was blank. Fill out a message or Click Cancel to cancel message."; } if (count($messages)) { displayForm($messages); return; } mail($recipient, $subject, $body) or die("unable to send the mail!"); $escapedReturnUrl = htmlspecialchars($_POST['returnurl']); ?> <form method="POST" action="<?php echo $_SERVER['DOCUMENT_URL']?>"> <input type="submit" name="continue" value="Click Here To Continue"/> <input type="hidden" name="returnurl" value="<?php echo $escapedReturnUrl?>"/> </form> <?php } ?> i have a problem i cant solved for cople of hours! this is the function: function show_posts($user_id,$limit=0){ $posts = array(); $user_string = implode(',', $user_id); $extra = " and id in ($user_string) "; if ($limit > 0){ $extra = "limit $limit"; }else{ $extra = ''; } $sql = "SELECT userid, caption, stamp, filename FROM photographs WHERE userid in ($user_string) order by stamp desc $extra"; //echo $sql; $result = mysql_query($sql) or die(mysql_error()) ; while($data = mysql_fetch_object($result)){ $posts[] = array( 'stamp' => $data->stamp, 'userid' => $data->userid, 'caption' => $data->caption, 'filename' => $data->filename, ); } return $posts; } and thats the full error: Warning: implode() [function.implode]: Invalid arguments passed in C:\wamp\www\includes\functions.php on line 12 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') order by stamp desc' at line 2 and the intresting thing that if i echo the sql i get a working one i checked it in phpmyadmin + it shows what it need to show in the index.php if i comment the "or die(mysql_error()) " here the sql when its do echo SELECT userid, caption, stamp, filename FROM photographs WHERE userid in (4,7,2) order by stamp desc limit 5 so y the hell this problem is keep coming? i really cant understand what wrong! tnx for the help! Hello, I'm just a beginner (and french sorry for my language) : have some pb with my little implode function. It's Running well on my local webserver (MAMP - PHP PHP Version 5.2.17) but when tested on ovh server (PHP4) show this error : Warning: implode() [function.implode]: Invalid arguments passed in /homez.xx/myPathHere/entete.php5 on line 6 I understand 1/ that one argument is missing but don't find the right syntax 2/ I have tried to turn this file on php5 with this extension (ovh is under php4) Here is my code in page defining the value and where stay my query (entete.php5) <?php if (isset($theme)) { $t = implode(',',$theme); $lien = "aide.php5?theme=".$t; $aide = '<a href="'.$lien.'">'.$onglet[0].'</a>'; } else { $aide = ""; } ?> Here is my code in page which show result (aide.php5) $t = explode(',',$_GET['theme']); $n = count($t); if ($n == 1) { $where = "id = ".$t[0]; } else { $where = "id = ".$t[0]; for ($i=1;$i<$n;$i++) { $where .= " OR id=".$t[$i]; } } Hope someone kindly help me : thanks in advance Hi all. Here is the code:(thanks to jcbones) Code: [Select] if (($handle = fopen($source_file, "r")) !== FALSE) { $columns = fgetcsv($handle, $max_line_length, ","); foreach ($columns as &$column) { $column = str_replace(".","",$column); } while (($data = fgetcsv($handle, $max_line_length, ",")) !== FALSE) { while(count($data) < count($columns)) { array_push($data, NULL); } $c = count($data); for($i = 0; $i < $c; $i++) { $data[$i] = "'{$data[$i]}'"; } $sql[] = '(' . implode(',',$data) . ','.$_POST[group].')'; } $sql = implode(',',$sql); $query = "INSERT INTO mytable (".mysql_real_escape_string(implode(",",$columns)).",Custgroup,user_id) VALUES " . $sql . "\n"; mysql_query($query) or trigger_error(mysql_error()); fclose($handle); } } If my csv file is: lastname,firstname,gender bob,ah,male So now the query will be : INSERT INTO mytable (lastname,firstname,gender) VALUES ('bob',ah','male'). But how if I want to insert extra data into mysql together with the data in csv file? Such as I have a value $_POST['group'] = 'family', so I tried: Code: [Select] $sql[] = '(' . implode(',',$data) . ','.$_POST[group].')'; $query = "INSERT INTO $target_table (".mysql_real_escape_string(implode(",",$columns)).",custgroup) VALUES " . implode(',',$sql) . "\n"; But in the query it will become : INSERT INTO mytable (lastname,firstname,gender,custgroup) VALUES ('bob',ah','male',family). It didn't have single quote , so I have error to insert the record.Can I know how to solve this problem? Thanks. Hello all I've been using implode function of php and suddenly i encounter a problem regarding it.. Code: [Select] <?php $insertValues[] = "(default,'{$y}', '{$p}', '{$o}', '{$i}', '{$u}','AMM-40','test')"; $query_status = "INSERT INTO `mobile1_mn1`.`logs_inbound` (`log_id`, `originator`, `sender`, `date`, `time`, `message`, `company_id`, `keyword`) VALUES". implode(',',$insertValues); ?> When the information on $y,$p,$o,$i and $u does not have any single 'quotations' and commas it can save my information on database but when i have a string say for example the string is "he's good" and "Im, good" having a comma and quote it can't save my information anymore... can someone tell me why i have this problem? thanks in advance Code: [Select] while($row=mysql_fetch_assoc($query)) { $id = $row['id']; $col1 = $row['name1']; $col2= $row['name2']; $col3= $row['name3']; ${"$id"} = array("$col1","$col2","$col3"); ${"$s".$i}[] = ${"$id"}; } This is just a brief example of what i'm trying to accomplish,$i is incremented somewhere else. I'm trying to implode the arrays in the array. So below i have imploded the main array but how do i implode the other arrays? Code: [Select] for($i=0;$i<11;$i++) { $array = ${"s" . $i}; $outcomes = implode("",$array); //implodes main array } I came accross a problem where im not sure how to add the word "and" inbetween my variables. I'm only displaying one $field below but i have 6 of them. If I add and as the seperator in the implode it will repeat it and and. Also it will put it at the end Code: [Select] <?php $field1 = "Farms to " . $_POST['farms_population']; $a = array("$field1", "$field2", "$field3", "$field4", "$field5", "$field6"); $_SESSION['changed'] = "You have changed " . implode(" ",$a); echo $_SESSION['changed']; ?> wanting it to echo something like You have changed Farms to 30 and Larva Pools to 10 and Homes to 10 <?php if(!isset($_SESSION)) { session_start(); } // UNCOMMENT NEXT LINE TO PRINT THE $_SESSION ARRAY TO THE SCREEN . . . // echo '<pre>'; print_r($_SESSION); echo '</PRE>'; if(empty($_SESSION['userID']) || $_SESSION['authorized'] != true ) { header("Location: login.php"); exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/xml; charset=utf-8" /> <meta http-equiv="refresh" content="5;url=editprofile.php"> <title>Saving Profile</title> </head> <body> <?php require_once ("dbconn.php"); ?> <?php $userID = $_SESSION['userID']; $insert_query = 'insert into users WHERE userID='$userID'( aim, msn, yim, psnID, xblGamertag, otherContact ) values ( "' . $_POST['aim'] . '", "' . $_POST['msn'] . '", "' . $_POST['yim'] . '", "' . $_POST['psnID'] . '", "' . $_POST['xblGamertag'] . '", "' . $_POST['otherContact'] . '" )'; mysql_query($insert_query); ?> Your profile has been saved! You will now be redirected from where you came from. <br /><a href="editprofile.php" title="Click here if you don't want to wait">Click here if you don't want to wait.</a> </body> </html> It creates a new record but I want it to update an existing one. It's an editprofile script. This is my code for displaying images from a folder:
function generate_img ($imagepointer, $imageornot){ if($imageornot == 1){ $var = getcwd(); $dirlocation = $var."\\imageuploads\\".$imagepointer; $files = array_diff(scandir($dirlocation), array('..', '.')); foreach ($files as $image){ $data[] = array('label' => '<img src="/imageuploads/'.$imagepointer.'/'.$image.'" alt="thumbnail"> <br/>'); }; return $data; } else { return FALSE; } } I'm using it with print_r: <p><?php print_r(generate_img($imagepointer, $imageornot)); ?></p> Working ok, but obviously not good for a live site. Is implode() a good idea in this situation? And how would I use it? Appreciated. hi all ,, I have a table : test (id , name , title , area , city) and I want from user to insert more than one record .. I made the script but I don't know there are better than this code .. <!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>My test</title> </head> <body> <table align="center" width="70%"> <tr> <form action="<?php $_SERVER['PHP_SELF']?>?>" method="get"> <?php if($_GET['submit']){ $con = mysql_connect("localhost","root",""); $db = mysql_select_db("test",$con); for($i = 1 ; $i < 10 ; $i++){ $name = $_GET['name'.$i]; $title = $_GET['title'.$i]; $area = $_GET['area'.$i]; $city = $_GET['city'.$i]; $sql = "INSERT INTO `test`.`test` (`title` ,`name` ,`area` ,`city`)VALUES ( '$name', '$title', '$area', '$city');"; $query = mysql_query($sql , $con); } }else { $con = mysql_connect("localhost","root",""); $db = mysql_select_db("test",$con) or die (mysql_error()); echo '<tr><td>Name</td><td>Title</td><td>Area</td><td>City</td></tr>'; for ($i = 1 ; $i < 10 ; $i++){ echo '<tr><td><input type="text" name="title'.$i.'" /></td> <td><input type="text" name="name'.$i.'" /></td> <td><input type="text" name="area'.$i.'" /></td> <td><input type="text" name="city'.$i.'" /></td></tr> <br /> '; } echo '<tr><td colspan="4"><input type="submit" name="submit" value="submit" /></td></tr>'; } ?> </form> </tr> </table> </body> </html> I wait you to advise me and I want your opinion .. than you very much .. I am trying to create a query to insert data into a table in my Access database. I have the following query:
INSERT INTO Issues (DateRequested, CustomerID, ComputerID, Issue, ItemsIncl, ImageName) VALUES (#1/14/2015#, 1, 1, "Computer freezes while I'm on the internet.", "AC Adapter", "none.gif")which should be performed from within my PHP page. However, when I check the database afterward, the new record isn't there. I then tried performing the query directly in Access and it worked fine. Why would it work in Access, but not when I run the same query in PHP? Chris This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=315384.0 Greetings mates, I have not been here for years. I have been thrust into an app written by someone else. The requirement is to amend, not edit, an existing record. In other words, rather than edit an existing record, management would like an empty new text box to enter amended data and save to another table so that when queried, would display existing record and the newly amended record. Below is an ID of an existing record: $sql = "SELECT * FROM DBO.existingTable where year_created = 2019 Order by Id"; echo '<table id="results-table"> <thead> <tr> <th>ID</th> <th>Edit</th> <th>View PDF</th> <th>Task Lead</th> <th>Task Title</th> <th>Division</th> </tr> </thead>'; while ( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_BOTH ) ) { $div = ($row['division'] == "1" ? "Divname" : ($row['division'] == "2" ? "Highway" : "NULL")); $taskType = ($row['task_type'] == 0 ? "Annual" : ($row['task_type'] == 1 ? "Carryover" : ($row['task_type'] == 2 ? "New" : "NULL"))); if($row['year_created'] == 2019){ echo '<tr id="taskId"> <td>'.$row['Id'].'</td> <td><a href="project_edit.html?id='.$row['Id'].'" target="_blank">Edit</a></td> <td><input type="button" onclick="getReport('.$row['Id'].')" value="View PDF"></td> <td>'.$row['task_lead'].'</td> <td>'.$row['task_title'].'</td> <td>'.$div.'</td> </tr> } } echo '</table>' The above code isa snippet of code in edit.php. What I would like to do is grab the ID which is '.$row['Id'].' from this edit page and use it when inserting the amended code which is in insert,php file: //The ID from edit.php code should go here $task_lead = (empty($_POST['task_lead'])) ? "''" : "'" . str_ireplace( "'", "", $_POST[ 'task_lead' ] ) . "'"; $task_title = (empty($_POST['task_title'])) ? "''" : "'" . str_ireplace( "'", "''", $_POST[ 'task_title' ] ). "'"; $division = (empty($_POST['division'])) ? "''" : "'" . str_ireplace( "'", "", $_POST[ 'division' ] ) . "'"; //Then my insert statement should be something like this: $sql = "INSERT INTO DBO.Amended_Records ({id from table with existing record}, amended_taskActivities, amended_taskProducts,amendscope_dev_fhwa, amendconsultant_procurement, amendcontract_negotiations, amendconsultant_notice, amendtotal_duration, year_created) VALUES ({$rowId - that I need to get from edit.php}, $amendproposed_activities, $amendanticipated_products,$amendscope_dev_fhwa,$amendconsultant_procurement,$amendcontract_negotiations,$amendconsultant_notice,$amendtotal_duration, 2021)"; When I insert this record into the DB, the id from edit.php is getting inserted as null. Can you please advise how I can resolve this? I have 2 tables, access_level and pages. In pages table i will have all the details of page like page_id, code, herf, pagename.. and i will select few from this table and store it in access_level table depending on the department and position. Now while editing, i will display all the pages which is stored in access_level pages with a particular page code along with those pages from pages table. if the page_id exists in access_level table, its has to get updated, if its not present then it should get inserted into access_level table. These things am doing with checkbox and <li>. my access_level table access_level.JPG 18.19KB 0 downloads and my pages table pages.JPG 37.86KB 0 downloads here is my code $s1 = mysql_query("SELECT pages.page_id as pid, pages.code, pages.page, pages.href, access_level.aid, access_level.page_id as pgid, access_level.department, access_level.position, access_level.active FROM pages LEFT JOIN access_level ON (pages.page_id=access_level.page_id AND access_level.department=".$department." AND access_level.position=".$position.") WHERE pages.code='snor die(mysql_error()); while($s2 = mysql_fetch_array($s1)) { ?> <tr><td><li><?php echo $s2['page']; ?> </td><td><input type="checkbox" name="sn[]" value="<?php echo $s2['pid']; ?>" <?php if($s2['pgid'] === $s2['pid']) echo 'checked="checked"';?> /> <input type="hidden" value="<?php echo $s2['pid']; ?>" name="page_id[<?php echo $s2['pgid']; ?>]">while submittings i am not getting the logic, how can be done. Please somebody suggest me |