/* get resultset for metadata */
$result = $stmt->result_metadata();
/* retrieve field information from metadata result set */
$field = $result->fetch_field();
printf("Fieldname: %s\n", $field->name);
/* close resultset */
$result->close();
/* close connection */
$mysqli->close();
?>
Example 20.176. Procedural style
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "test");
mysqli_query($link, "DROP TABLE IF EXISTS friends");
mysqli_query($link, "CREATE TABLE friends (id int, name varchar(20))");
mysqli_query($link, "INSERT INTO friends VALUES (1,'Hartmut'), (2, 'Ulf')");
$stmt = mysqli_prepare($link, "SELECT id, name FROM friends");
mysqli_stmt_execute($stmt);
/* get resultset for metadata */
$result = mysqli_stmt_result_metadata($stmt);
/* retrieve field information from metadata result set */
$field = mysqli_fetch_field($result);
printf("Fieldname: %s\n", $field->name);
/* close resultset */
mysqli_free_result($result);
/* close connection */
mysqli_close($link);
?>
See Also
mysqli_prepare
mysqli_free_result
20.7.3.10.25. mysqli_stmt::send_long_data,
Copyright 1997-2012 the PHP Documentation Group. [2230]
•
mysqli_stmt::send_long_data
mysqli_stmt_send_long_data
Send data in blocks
Description
Object oriented style
bool mysqli_stmt::send_long_data(
int param_nr,
MySQL Improved Extension (Mysqli)
mysqli_stmt_send_long_data
2471
Need help?
Do you have a question about the 5.0 and is the answer not in the manual?
Questions and answers