How to fetch phone number from mysql column and store it in one 1-dimensional array

Viewed 22

I have a project that i need to fetch phone number from phone number column from mysql database and store it into a 1-dimensional array.

   $sql = "SELECT phone_number FROM student WHERE faculty='$faculty' and department='$department' and course='$course' and level='$level' and session='$session'";
        $query = mysqli_query($connection, $sql);
        if ($query) {
            $numRow = mysqli_num_rows($query);
        if ($numRow > 0) {
            while ($row = mysqli_fetch_assoc($query)) {
                $phone = $row;

            }

        }
    }'
0 Answers
Related