Hi again,
I have managed to make a suitable way of adding a interview which can be found Here but as you can see the edit section is where i am needing help with.
I simply want it to ouput what is currently in the databse but cant seem to output them into each line of the corosponding Questions and answers. Then be able to delete or add lines where needed

I have kept the amount of Q's and A's in a table called qna if that helps at all

Here is the edit page
you can just foccus on the part after
//-------------------------edit


PHP Code:
<? 
require '../db_connect.php';
include 
'adminmenu.php';
include 
'sub.php';
echo
'<div align="center"><br>';

//-------------------------------------------------INDEX
if ($_GET['action'] == '') {
echo
'<ol>';
$sql "SELECT *
            FROM interview ORDER BY id DESC"
;   
    
    
$res $db_object->query($sql);        

        if (
DB::isError($res)) {        
            die(
$res->getMessage());    
        } 

while (
$row $res->fetchRow(DB_FETCHMODE_OBJECT)) {

        echo
'<strong><li>Interview With '.$row->interviewie.'</li></strong><br>
        Added  by '
.$row->interviewer.' on '.$row->dop.'<br>
        <a href="?action=edit&id='
.$row->id.'">Edit Interview</a><br>
        <a href="?action=delete&id='
.$row->id.'">Delete Interview</a><br><br>';
}
    echo
'</ol>';
}

//-------------------------------------------------EDIT

if ($_GET['action'] == 'edit') {

$sql "SELECT *
            FROM interview WHERE id = '"
.$_GET['id']."'";   
    
    
$res $db_object->query($sql);        

        if (
DB::isError($res)) {        
            die(
$res->getMessage());    
        } 

while (
$row $res->fetchRow(DB_FETCHMODE_OBJECT)) {
    
$questions $row->questions;
    
$answers $row->answers;
    
$numlines $row->qna;
    
                

 
$qna = array();
  
$x=1;
  
$w=1;
  
// Build an Array of the questions and answers
  
  
while($_POST['question'.$x])  {
      if (
$_POST[$x] != 'Delete') {
      for(
$y=0;$y<=$numlines-1;$y++) {
                
$question explode("|SEPARATOR|" $questions);
                
$question[$y] = $question[$y]; 

                
$answer explode("|SEPARATOR|" $answers);
                
$answer[$y] = $answer[$y]; }
            
            
$qna[$w]['question'] = $question[$y];
            
$qna[$w]['answer'] = $answer[$y];
          
$w++;
        }
        
$x++;
  }

        echo
'<strong><li>Interview With '.$row->interviewie.'</li></strong><br>
        Added  by '
.$row->interviewer.' on '.$row->dop.'<br>
        
        <FORM METHOD="post" ACTION="'
.$PHP_SELF.'?action=edit"><TABLE width="518" height="211" border="0" align="center" cellpadding="0" cellspacing="0">
        <TR><TD width="234">   name of interviewer
          <INPUT TYPE="text" NAME="interviewer" value="'
.$row->interviewer.'"></TD>
        <TD width="234">name of interviewie
          <input type="text" name="interviewie" value="'
.$row->interviewie.'"></TD>
        <TD width="50">&nbsp;</TD>
        </TD></tr>
                    <TD>
                    <TD>
           <TR><TD height="109"><p>   Question
         <textarea name="question'
.$y.'" cols="40" wrap="VIRTUAL"></textarea>
          </p></TD>
             <TD>Answser
        <textarea name="answer'
.$y.'" cols="40" wrap="VIRTUAL"></textarea></TD>
             <TD></TD>

         <TR><TD><INPUT TYPE="submit" NAME="addline" class="button" VALUE="Add Line to Interview"><br><br></TD></TR>
         '
;
              for(
$y=0;$y<=$numlines;$y++) {
                

                echo 
'<TR><TD>    <p>Question #'.$y.'
                  <textarea name="question'
.$y.'" cols="40" wrap="VIRTUAL">'.$qna[$y]['question'].'</textarea>
                </p></TD>
               <TD>Answser to Question #'
.$y.'
                 <textarea name="answer'
.$y.'" cols="40" wrap="VIRTUAL">'.$qna[$y]['answer'].'</textarea></TD>
               <TD>     <p><input type="submit" name="'
.$y.'"  class="button" value="Delete">         </p>
      '
; }
              if (
$y == '1' ) {echo '';} else{ echo' <TR><TD><br><br><INPUT TYPE="submit" class="button" NAME="submit" VALUE="Edit Interview"></TD></TR>';} echo'
                  </TABLE></FORM>'
;
}

echo
'    <br><br><a href="?action=">BACK</a><br>';

}
?></div>
Thanks