php select data from mysql database without column name

Solutions on MaxInterview for php select data from mysql database without column name by the best coders in the world

showing results for - "php select data from mysql database without column name"
Joséphine
24 Jul 2016
1SHOW COLUMNS FROM table_name;
Ignacio
26 Nov 2019
1function sql($sql) {
2  global $db_cnx;
3    $T_Return=array();
4    $result=mysqli_query($db_cnx,$sql);
5   
6    $i=0;
7    while ($i < mysqli_num_fields($result)) {           
8        $fields[]=mysqli_fetch_field($result);
9        $i++;
10    }
11   
12    while ($row=mysqli_fetch_row($result)) {               
13        $new_row=array();
14        for($i=0;$i<count($row); $i++) {
15            $new_row[ $fields[$i]->table][$fields[$i]->name]=$row[$i];
16        }
17        $T_Return[]=$new_row;
18    }
19
20   
21    return $T_Return;
22}
similar questions