如何将网站连接到 mysql 数据库

how to connect the website to the mysql database

我尝试将表单连接到网站,但在我单击提交按钮后出现错误。

Fatal error: Uncaught Error: Call to undefined function mysql_fetch_object() in C:\xampp\xampp\htdocs

错误信息说错误来自这行代码:

while($row = mysql_fetch_object($result)){ 

谁能帮我解释一下为什么会出现这种错误

我们需要知道 $result 是什么,有时缺少拼写和错误的代码会导致错误 通常我使用 mysqli_fetch_assoc 和 mysqli_fetch_array,因为 mysql 已在 PHP ver7

中删除