function table($sql,$border)
{
$con = mysqli_connect("localhost","root","","dbit36");
$resource = mysqli_query($con,$sql);
echo"<table border=0>";
for($i = 0; $i < mysqli_num_fields($resource); $i++)
{
echo "<td style='border:".$border."1px dotted;'><b><font color='990099'size='10'>".mysql_field_name( $resource, $i )."</b></font></td>";
}
echo "</tr>";
while($row = mysqli_fetch_array($resource))
{
echo "<tr>";
for($i = 0; $i < mysqli_num_fields($resource); $i++)
{
echo "<td style='border:".$border."px ridge;'>".$row[$i]."</td>";
}
echo "</tr>";
}
echo "</table>";
}
I know that using mysql
function are deprecated in php 5.5+ versions thats why my question is there any mysqli
function that can get the name of the specified field in a result?