手順
プロシージャの作成 prSample1()
始める
名前を選択
FROM 学生リスト;
終わり;
PHPコード
$objMain = new Main();
$objMain->getStudentsName();
クラス メイン
{
関数 __construct()
{
$Conn = new mysqli('localhost', 'root', '', 'sampleDB');
}
関数 getStudentsName()
{
$strSQL = "prSample1() を呼び出す";
$stmt = $Conn->prepare($strSQL);
$stmt->execute();
$stmt->bind_result($Name);
while($stmt->fetch())
$arrNames = array('Name'=>$Name);
}
エラーや警告は表示されません。
最後のブレースが終了する前の配列の値を取得した後、次のステートメントが php コードに与える影響を知りたいです。
1.$stmt->close()
2.$stmt->reset()
また、次のステートメントを使用する場所と使用方法を教えてください。
1.$stmt->free_result()
2.$stmt->store_result()
3.$stmt->bind_result()
コーディング標準と準備されたステートメントの適切な使用方法に間違いがあった場合は、修正してください