<body> <?php mysql_connect("localhost", "root", ""); mysql_select_db("wrapper"); if(isset($_POST['update'])){ $UpdateQuery = "UPDATE articles_selection SET article = '$_POST[article]' WHERE id ='$_POST[hidden]'"; mysql_query($UpdateQuery, $sql); }; $sql = mysql_query("SELECT * FROM articles_selection"); echo "<table border = '1'> <tr> <th>ID</th> <th>ARTICLE</th> </tr>"; while($record = mysql_fetch_array($sql)){ echo "<form action="index1.php" method ="post">"; echo "<tr>"; echo "<td>" . "<input type = "text" name = "id" value =" . $record['id'] . " </td>"; echo "<td>" . "<input type = "text" name = "article" value =" . $record['article'] . " </td>"; echo "<td>" . "<input type = "hidden" name = "hidden" value =" . $record['id'] . " </td>"; echo "<td>" . "<input type = "submit" name = "Update" value = "update">" . " </td>"; echo "</tr>"; echo "</form>"; } echo "</table>"; ?> </body>
echo "<form action="\"index1.php\"" method="\"post\"">"; </form>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)