Zrobiłem dwa pliki. W jednym jest tabela z użytkownikami a druga to tabela z wyświetlonym rekordem.Poprostu przyznam się że nie wiem jak wysłać zaznaczone rekordy do drugiej tabeli. Przepraszam z góry za tak olbrzymi kod ale chcę dokładnie wiedzieć gdzie jest przyczyna.
<?php require_once('../Connections/myconn.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $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": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $maxRows_Recordset1 = 10; $pageNum_Recordset1 = 0; $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; $query_Recordset1 = "SELECT user_id, firstname, lastname, username FROM userlogin"; $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else { } ?> <form action="phplist.php" method="get"> <table width="200" border="1" align="center"> <tr> <td>Oznacz</td> <td>ID</td> <td>Imie</td> <td>Nazwisko</td> <td>Nick</td> </tr> <?php do { ?> <tr> <td><input name="checkbox" type="checkbox" id="checkbox" value="<?php echo $row_Recordset1['user_id']; ?>"> <label for="checkbox"></label></td> </tr> </table> <input type="submit" name="button" id="button" value="Edit"> <input type="hidden" name="hiddenField" id="hiddenField"> </form> <?php ?>
Jak zrobic że jak zaznaczę rekordy za pomocą checkboxa pokazały się tylko te rekordy które są zaznaczone?
Zgóry dzięki za pomoc
<?php require_once('../Connections/myconn.php'); ?><?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $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": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $maxRows_DetailRS1 = 10; $pageNum_DetailRS1 = 0; $pageNum_DetailRS1 = $_GET['pageNum_DetailRS1']; } $startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1; $colname_DetailRS1 = "-1"; $colname_DetailRS1 = $_GET['recordID']; } $query_DetailRS1 = sprintf("SELECT * FROM userlogin WHERE user_id = %s", GetSQLValueString($colname_DetailRS1, "int")); $query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1); $totalRows_DetailRS1 = $_GET['totalRows_DetailRS1']; } else { } ?> <table border="1" align="center"> <tr> <td>user_id</td> </tr> <tr> <td>firstname</td> </tr> <tr> <td>lastname</td> </tr> <tr> <td>username</td> </tr> <tr> </table> </body> </html><?php ?>
CZy jest ktoś taki który pomoże rozwiązać problem?