dongshan4316 2016-04-11 05:06
浏览 10

更新mysql数据库错误

im a beginner and also a diploma student... i trying to update my mysql database but there is some error... please help me solve it...

this is my error:

Fatal error: Uncaught Error: Call to undefined function mysql_select_db() in C:\xampp\htdocs\SLR\Update S110 PC01.php:17 Stack trace: #0 {main} thrown in C:\xampp\htdocs\SLR\Update S110 PC01.php on line 17

this is my code:

<html>
<body>
</br>
</br>
<center>
<div align="center">
</br>
</br>
</br>
<?php 
include("dbconnect.php");

if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("s110_pc01", $con);
$sql = "UPDATE  SET soft_name='$_POST[soft_name]', installed_date='$_POST[installed_date]', expiry_date='$_POST[expiry_date]', product_key='$_POST[product_key]' WHERE soft_id='$_POST[soft_id]'";
$retval=mysql_query($sql);
if(! $retval )
{
  die('Could not Update data: ' . mysql_error());
}
echo "Successfully updated
";
mysql_close($con);

?>
<input type="button"value="Finish"onclick="window.location.href='managerhome.php'">
</form>
</table>
</div>
</body>
</html>
  • 写回答

3条回答 默认 最新

  • duanchi0883649 2016-04-11 05:11
    关注

    All of the mysql_* functions are deprecated and have been removed from PHP 7. DO NOT USE THESE FUNCTIONS! Instead use either the mysqli functions or the PDO functions.

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向