I m trying to understand mysql in combination with php, and just tried to create a form to update something in the database.
I m getting the old value in as parameter which has to be changed. Which i place in a field to be edited. As soon as i press the button a query has to run that updated the old value to the new one.
假设你有以下代码:
<?php
$oldvalue = $_REQUEST[ value ];
?>
<form action="change.php">
<input type="text" name="newvalue" value="<?= $oldvalue ?>">
<input type="submit" value="send">
</form>
字段中的旧值现在可以更改, 一旦按钮被提交, 我要运行查询 :
UPDATE test SET value= $newvalue WHERE value= $oldvalue
问题在于: 如何将旧值与窗体一起发送? 这样我就可以用更改来运行查询 。 php
谢谢!