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";
            $createnew1="";
        if($counter>0)
        {
            for($i = 0; $i < $counter; $i++){
                $row=$result->fetch_assoc();
                $createnew1.",".$row['qno']." INT[3]";

            } 
        }
        $createnew1.")";

        echo $createnew.$createnew1;
        $re=$mysqli->query($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?