Oracle 5.0 Reference Manual page 2511

Table of Contents

Advertisement

printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5";
if ($result = $mysqli->query($query)) {
/* Get field information for all columns */
while ($finfo = $result->fetch_field()) {
printf("Name:
printf("Table:
printf("max. Len: %d\n", $finfo->max_length);
printf("Flags:
printf("Type:
}
$result->close();
}
/* close connection */
$mysqli->close();
?>
Example 20.194. Procedural style
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5";
if ($result = mysqli_query($link, $query)) {
/* Get field information for all fields */
while ($finfo = mysqli_fetch_field($result)) {
printf("Name:
printf("Table:
printf("max. Len: %d\n", $finfo->max_length);
printf("Flags:
printf("Type:
}
mysqli_free_result($result);
}
/* close connection */
mysqli_close($link);
?>
The above examples will output:
Name:
Name
Table:
Country
max. Len: 11
Flags:
1
Type:
254
Name:
SurfaceArea
Table:
Country
max. Len: 10
MySQL Improved Extension (Mysqli)
%s\n", $finfo->name);
%s\n", $finfo->table);
%d\n", $finfo->flags);
%d\n\n", $finfo->type);
%s\n", $finfo->name);
%s\n", $finfo->table);
%d\n", $finfo->flags);
%d\n\n", $finfo->type);
2491

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents