"how can this be done with the same result using mysqli?" Code Answer

1

the function mysqli_fetch_field_direct returns an object, where as mysql_field_flags retuns a string. hence your direct use of strpos won't work.

if($field_flags == false) {
    for($j=0; $j<$num_fields; $j++) {
        $field_flags[$j] = mysqli_fetch_field_direct($result, $j);
        if(strpos($field_flags[$j]->flags, 'not_null') !== false) {
           //do something here
        } else {
           //do something else
    }
}

more here on php.net

By volkovik on September 10 2022

Answers related to “how can this be done with the same result using mysqli?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.