您好我想用按钮点击更新我的数据库,并在输入值中写入了什么。
$host = "****";
$conn = db2_connect ($host,"*****", "*********");
<input id='focusedInput' type='text' name='prodinfo' value=''>
<button type='submit' class='btn btn-default' value='Byt information's text'>
</button>
为什么我对sql的更新不起作用的任何建议?我只能“无法更新数据msg&#39;
”if(isset($_POST['submit']))
{
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
$prodinfo = $_POST['submit'];
$sql = "UPDATE Persons ". "SET Hobby = $prodinfo".
"WHERE Id = 99999" ;
$retval = mysql_query( $sql, $conn );
if(! $retval ) {
die('Could not update data: ' . mysql_error());
}
echo "Updated data successfully\n";
mysql_close($conn);
}