Printing SQL table header names via PHP -
i have this. i'm trying capture sql table header name php. works fine me.
however i'm struggling tune echo whole list of table header names except 1 or 2 dont need print.
suppose names of column number 10 , 15 not need printed how tweak attempt?
here goes the code far.
// db1 connection $sql = "select * sal_vol;"; $result = mysqli_query($db1,$sql); $i = 0; while($i<mysqli_num_fields($result)) { $meta=mysqli_fetch_field($result); echo $i.".".$meta->name."<br />"; $i++; }
while($i<mysqli_num_fields($result)) { if ($i == 10 || $i == 15) continue; $meta=mysqli_fetch_field($result); echo $i.".".$meta->name."<br />"; $i++; }
Comments
Post a Comment