output columns as an array for inarray checking
===

The following code works, however I was wondering if there was a way to clean up the top part where the columns are outputted as an array. I didnt include the full script because it is too long, but basically i have three different queries and I want to match the values from the table (resultInput...textarea...images) with the editable values I defined. In order for me to do this I need to have the columns outputted as an array, I was wondering if there was a cleaner way of doing this (top-part until //end output as array) than what I have?

        $ArrayResultInput = array();
        while ($row = mysql_fetch_array($resultInput)) {
            $ArrayResultInput[] = $row['Field'];
        }
        $inArrayResultInput = $ArrayResultInput;
        //
        $ArrayResultTextarea = array();
        while ($row = mysql_fetch_array($resultTextarea)) {
            $ArrayResultTextarea[] = $row['Field'];
        }
        $inArrayResultTextarea = $ArrayResultTextarea;
        //
        $ArrayResultImages = array();
        while ($row = mysql_fetch_array($resultImages)) {
            $ArrayResultImages[] = $row['Field'];
        }
        $inArrayResultImages = $ArrayResultImages;
        // end output as array
        while ($row = mysql_fetch_assoc($resultUpdate)) {
            foreach ($row as $fieldname => $value) {
                if (in_array($fieldname, $inArrayResultInput)) {
                    echo '<div class="wrapper"><label>' . ucfirst(str_replace('_', ' ', $fieldname)) . '<br><input name="' . $fieldname . '" type="text" class="input" value="' . $value . '"><br></label></div>';
                }
            }
            foreach ($row as $fieldname => $value) {
                if (in_array($fieldname, $inArrayResultTextarea)) {
                    echo '<div class="wrapper"><label>' . ucfirst(str_replace('_', ' ', $fieldname)) . '<br><textarea name="' . $fieldname . '">' . $value . '</textarea><br></label></div><script type="text/javascript">CKEDITOR.replace(\'' . $fieldname . '\',{toolbar:\'Basic\'});</script>';
                }
            }
            foreach ($row as $fieldname => $value) {
                if (in_array($fieldname, $inArrayResultImages)) {
                    echo '<div class="wrapper"><span class="form-file">' . ucfirst(str_replace('_', ' ', $fieldname)) . '</span><input id="' . $fieldname . '" name="' . $fieldname . '" type="input" class="input" value="' . $value . '"><input type="button" value="Browse" onclick="CKFinder.popup(\'../\', null, null, SetFileField_' . $fieldname . ');" class="button browsebttn medium"><br></div><script type="text/javascript">function SetFileField_' . $fieldname . '(fileUrl){document.getElementById(\'' . $fieldname . '\').value=fileUrl;}</script>';
                }
            }
        }