我需要有关此PHP更新代码的帮助。 [英] Please I need help with this PHP Update code.

查看:88
本文介绍了我需要有关此PHP更新代码的帮助。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我需要帮助从html表单更新我的数据库。



我是PHP的新手。我无法弄清楚错误的位置。



请大家帮忙吗?



谢谢你非常喜欢!



Hello everyone!

Please I need help updating my database from a html form.

I''m quite new to PHP. I can''t figure out where the error is.

Please can anyone help?

Thank you very much!

<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>









谢谢非常多!





Thank you very much!

推荐答案

_POST [''update''])){
_POST[''update''])){


UpdateQuery =UPDATE articles_selection SET article = ''
UpdateQuery = "UPDATE articles_selection SET article = ''


_POST [article]''WHERE id =''
_POST[article]'' WHERE id =''


这篇关于我需要有关此PHP更新代码的帮助。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆