
Originally Posted by
sickel2
Any ideas?
try this way -
PHP Code:
$mysqli = new mysqli("localhost", "myusername", "mypassword", "mydatabase");
if (mysqli_connect_errno()) {
printf("Connect failed.\n");
exit();
}
function get_fields($user) {
global $mysqli;
$query = "SELECT * from current";
if ($result = $mysqli->query($query)) {
$finfo = $result->fetch_fields();
foreach ($finfo as $val) {
printf("Name: %s\n", $val->name);
printf("Table: %s\n", $val->table);
printf("max. Len: %d\n", $val->max_length);
printf("Flags: %d\n", $val->flags);
printf("Type: %d\n\n", $val->type);
}
$result->close();
}
return $finfo;
}
Bookmarks