mysql_field_name to the new mysqli

后端 未结 5 1506
生来不讨喜
生来不讨喜 2021-01-01 13:01

I have a way to get the name of the columns of a table. It works fine but now I want to update to the new mysqli ? (I tried the mysqli_fetch_field but I don\'t know how to a

5条回答
  •  北荒
    北荒 (楼主)
    2021-01-01 13:57

    This is the way to implement this missing function:

    function mysqli_field_name($result, $field_offset)
    {
        $properties = mysqli_fetch_field_direct($result, $field_offset);
        return is_object($properties) ? $properties->name : null;
    }
    

提交回复
热议问题