echo "<form action='page.php?action=order' method='POST'>"; $sql = "SELECT * FROM `page` ORDER BY `order` DESC"; $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_object($result)) { echo "<input type='text' name='order' value='$row->order'>"; } echo "<input type='submit' value='save'></form>";
$sql = "UPDATE `page` SET order = '".$_POST['order']."'"; mysql_query($sql) or die(mysql_error());