程序
创建过程 prSample1()
开始
选择名称
来自学生名单;
结尾;
PHP 代码
$objMain = 新的 Main();
$objMain->getStudentsName();
主类
{
函数 __construct()
{
$Conn = new mysqli('localhost', 'root', '', 'sampleDB');
}
函数 getStudentsName()
{
$strSQL = "调用 prSample1()";
$stmt = $Conn->prepare($strSQL);
$stmt->执行();
$stmt->bind_result($Name);
while($stmt->fetch())
$arrNames = array('Name'=>$Name);
}
我没有收到任何错误或警告。
在获取最后一个大括号结束之前的数组中的值后,我想知道以下语句对 php 代码的影响。
1.$stmt->关闭()
2.$stmt->reset()
还让我知道在哪里使用以下语句以及如何使用它们
1.$stmt->free_result()
2.$stmt->store_result()
3.$stmt->bind_result()
如果我在编码标准和使用准备好的语句的正确方法方面有任何错误,请纠正我