How to send updated data of an HTML table to another php file? -


i have html table 2 rows, , 4 columns. first row not editable, cells in second row editable. need find way send updated cell information php file. far i've been using $_get['foo']; , working. until now.

while($row = mysql_fetch_assoc($result)) {     echo "<tr>";     foreach ($row $cname => $cvalue) {         echo "<td input type=\"text\" name=\"$cname\" contenteditable=\"true\" align = \"center\"> $cvalue </td>";     }     echo "</tr>"; } 

in other php file, can't seem new data $_get. ideas? i'm going use new data update row in database mysql query.

here's whole form.

<form action="edit_record_result_final.php" method="get"> <div style="text-align:center">     <?php     $typename = $_get["typename"];     $keyvalue = $_get["keyvalue"];     $link = mysql_connect('localhost', 'root', '');     if (!$link) {         die('could not connect: ' . mysql_error());     }     if (!mysql_select_db('cmpe')) {         die('could not select database: ' . mysql_error());     }     $sql="select data_type     information_schema.columns     table_schema = 'cmpe'     , table_name = '$typename'";     $sql2="select count(*)     information_schema.columns     table_schema = 'cmpe'     , table_name = '$typename'";     $result = mysql_query($sql);     if (!$result) {         $message  = 'invalid query: ' . mysql_error() . "\n";         die($message);     }     $keytype = mysql_result($result, 0);     $result = mysql_query($sql2);     $fieldnum = mysql_result($result, 0);     $sql="select column_name     information_schema.columns     table_schema = 'cmpe'     , table_name ='$typename'";     $result = mysql_query($sql);     $header = "";     echo "<table align=\"center\" border=\"15\" cellspacing=\"2\" cellpadding=\"4\">";     echo "<caption> $typename </caption>";     echo "<tr>";     for($i = 0; $i<$fieldnum; $i++){         $header = mysql_result($result, $i);         echo "<td align = \"center\"><b> $header </b> </td>";     }     echo "</tr>";      $sql="select column_name     information_schema.columns     table_schema = 'cmpe'     , table_name ='$typename'";     $result = mysql_query($sql);     if (!$result) {         $message  = 'invalid query: ' . mysql_error() . "\n";         die($message);     }     $keyname = mysql_result($result, 0);     if(strcmp($keytype, "varchar")==0) {         $sql = "select * $typename                 $keyname '$keyvalue' ";     }elseif(strcmp($keytype, "int")==0) {         $sql = "select * $typename                 $keyname = $keyvalue";     }else{         $sql = "select * $typename                 $keyname = '$keyvalue' ";     }     $result = mysql_query($sql);     if (!$result) {         die('could not query:' . mysql_error());     }else{         while($row = mysql_fetch_assoc($result)) {             echo "<tr>";             foreach ($row $cname => $cvalue) {                 echo "<td input type=\"text\" name=\"$cname\" contenteditable=\"true\" align = \"center\"> $cvalue </td>";             }             echo "</tr>";         }     }      echo "</table>";      ?>     <p><input type="submit" /></p> </div> 


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -