|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
<?php
|
|
|
//
normal query
|
|
|
$link
= mysqli_connect("localhost", $user, $passwd);
|
|
|
$rc
= mysqli_query($link, $sql);
|
|
|
//
prepare select, bind, execute, fetch, close
|
|
|
$stmt
= mysqli_prepare($link, "SELECT col1, col2 from my_table");
|
|
mysqli_bind_result($stmt,
&$c1, &$c2);
|
|
|
mysqli_execute($stmt);
|
|
|
mysqli_fetch($stmt);
|
|
|
$test
= array($c1,$c2);
|
|
|
mysqli_stmt_close($stmt);
|
|
|
mysqli_close($link);
|
|
|
?>
|
|
|
|