Posted by hughie on 08/07/07 11:54
Using mysqli, I'm trying to get meaningful info out of the 'flags'
item when running 'fetch_fields':
//code
$query = 'select * from table1 where id = 1';
if ($result = $mysqli->query($query)) {
$row = $result->fetch_assoc();
/* Get field information for all columns */
$finfo = $result->fetch_fields();
foreach ($finfo as $val) {
echo 'name: '.$val->name;
echo ', max len: '.$val->max_length;
echo ', flags: '.$val->flags;
}
$result->close();
}
$mysqli->close();
//end code
Using non mysqli one can use mysql_field_flags as in
http://www.php.net/mysql_field_flags.
How can this be done using mysqli?
Hughie
[Back to original message]
|