How to create a new table from an existing table with rows of the existing table as the columns of the new table. table

        $sql="SELECT qno FROM `cia1questions` ";
        $result = $mysqli ->query($sql);
        $counter = mysqli_num_rows($result);
        $createnew="CREATE table cia1markstest(
            Reg_no INT[12] primary key,
            st_name varchar[50] not null";
            for($i = 0; $i < $counter; $i++){
                $createnew1.",".$row['qno']." INT[3]";


        echo $createnew.$createnew1;

This is failing to create a new table. How can i fix this? When i echo the output sql string only the createnew string is reading. can someone help?