There is no mysql_field_name in php7. How to get the attribute name specified in the mysql result set?
仅有的幸福
仅有的幸福 2017-05-16 13:06:16
0
2
1157

mysqli_field_name($result,2); //email
I did not find a replacement function for mysql_field_name in php7. How can I achieve the same effect?
Thank you~

仅有的幸福
仅有的幸福

reply all(2)
洪涛

php7 canceled support for mysql extension

If you use mysqli, you can write like this

<?php
    $link = mysqli_connect('localhost', 'root', '', 'test');
    $result = $link->query('select * from jobs');

    echo $result->fetch_field_direct(0)->name;
我想大声告诉你

The mysql_ extension has been abandoned since php5.5. It has been removed since php7 and can be replaced with MySQLi or PDO_MySQL extension.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template