我是php新手。我想如何在单击批准按钮时将信息更新到已存在于数据库中的列?
答案 0 :(得分:0)
$mysqli = new mysqli(dbhost,dbuser,dbpass,dbc);
if ($mysqli->connect_error) {
die('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);
}
$query = $mysqli->query("");// update table query
mysql_close($mysqli);
答案 1 :(得分:0)
<input type"submit" name="approve" value="">
include("your dbconnection.php");
if(isset($_POST["approve"]))//approve button set
{
UPDATE `table_name`
SET column1=value, column2=value2,...
WHERE some_column=some_value
}
答案 2 :(得分:0)
答案 3 :(得分:0)
试试这个:
if(isset($_POST["Button"]))
{
if(mysql_query("UPDATE `table_name` SET column1=value, column2=value,... WHERE some_column=some_value"))
{
echo "Record Updated";
}
else
{
echo mysql_error();
}
}