Stworzyłem sobie formularz który wyświetla dane użytkowników. Chcę by po zmianie w polach i naciśnięciu wyslij aktualizował wszystkie rekordy. Jak na razie aktualizuje ostatni rekord. Myślę że błąd robię w zapytaniu update. Prosze o 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; } } $editFormAction = $_SERVER['PHP_SELF']; } { GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['id'], "int")); $updateGoTo = "reba.php"; $updateGoTo .= $_SERVER['QUERY_STRING']; } } $query_Recordset1 = "SELECT * FROM `admin`"; ?> <p> </p> <table width="200" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center"><strong>Id</strong></td> <td align="center"><strong>Name</strong></td> <td align="center"><strong>Email</strong></td> </tr> <?php do { ?> <tr> <td><label for="id"></label> <input name="id" type="text" id="id" value="<?php echo $row_Recordset1['id']; ?>" size="15" maxlength="15"></td> <td><label for="name"></label> <input name="name" type="text" id="name" value="<?php echo $row_Recordset1['name']; ?>" size="15" maxlength="15"></td> <td><label for="email"></label> <input name="email" type="text" id="email" value="<?php echo $row_Recordset1['email']; ?>" size="15" maxlength="15"></td> </tr> </table> <p> <input type="submit" name="button" id="button" value="Wyślij"> </p> <p> </p> <input type="hidden" name="MM_update" value="form1"> </form> <?php ?>