- i corresponding variable has type integer
- d corresponding variable has type double
- s corresponding variable has type string
- b corresponding variable is a blob and will be sent in packets
select
$sql = "select iduser,name,lastname from user";
$stmt = $conn->prepare($sql);
if ($stmt->execute()) {
$stmt->bind_result($id, $name, $lname);
$fileds = $stmt->result_metadata()->fetch_fields();
foreach ($fileds as $f){
echo "$f->name :";
}
echo "<br>";
while ($stmt->fetch()) {
echo "$id : $name : $lname <br>";
}
$stmt->free_result();
$stmt->close();
} else {
echo $stmt->error;
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น