作者:潮人搭配师er氵ic_161 | 来源:互联网 | 2023-05-19 14:27
This question already has an answer here:
这个问题在这里已有答案:
- How to get MySQLi error information in different environments 2 answers
如何在不同环境中获取MySQLi错误信息2答案
This is my code using OO style:
这是我使用OO风格的代码:
$query = "SELECT * FROM articles LIMIT 1";
$result=mysqli_query($db, $query) or die("Could Not execute query.");
$row = $result->fetch_assoc()
echo $row;
Code using Procedural:
代码使用程序:
$query = "SELECT * FROM articles LIMIT 1";
$result=mysqli_query($db, $query) or die("Couldn't execute query.");
$row = mysqli_fetch_row($result);
echo $row;
I have tried various different ways of getting this to work and the query never seems to execute.
我已经尝试了各种不同的方法来使这个工作,并且查询似乎永远不会执行。
I am new to mysqli
from mysql and am struggling with some of the differences. Apologies if there is an obvious answer to this question.
我是mysql的mysqli的新手,我正在努力解决一些差异。如果对这个问题有明显的答案,请道歉。
Any Help much appreciated.
任何帮助非常感谢。
2 个解决方案