Hadi Aghandeh
0
Q:

php select data from mysql database without column name

function sql($sql) {
  global $db_cnx;
    $T_Return=array();
    $result=mysqli_query($db_cnx,$sql);
   
    $i=0;
    while ($i < mysqli_num_fields($result)) {           
        $fields[]=mysqli_fetch_field($result);
        $i++;
    }
   
    while ($row=mysqli_fetch_row($result)) {               
        $new_row=array();
        for($i=0;$i<count($row); $i++) {
            $new_row[ $fields[$i]->table][$fields[$i]->name]=$row[$i];
        }
        $T_Return[]=$new_row;
    }

   
    return $T_Return;
}
0
SHOW COLUMNS FROM table_name;
0

New to Communities?

Join the community