如何在php中从mysql数据库中将值存储到数组中

The following is my scenario

i have the following databases

employee(e_no,e_name,e_contact,e_mail)
project(p_no,e_no,p_name)
project_assigned(id,pno,eno)
task(id,pno,tasks)

Now I have two particular files called employee_data_sheet.php and addtask.php I want to accomplish the following: When I post a task to addtask.php I want to view which employee has got the task in which project in employee_data_sheet.php

Following is the code snippet: (my addtask.php is working fine error in employee_data_sheet)

$query34="SELECT p_no FROM project_assign WHERE e_no='$empno'";
$res34=  mysql_query($query34);
while($row34=  mysql_fetch_array($res34))
{
  $pnum=array();
  $pnum=$row34['p_no'];
  $query35="SELECT p_name FROM project WHERE p_no='$pnum'";
  $res35=mysql_query($query35);
  while($row35=  mysql_fetch_array($res35))
  {
    $prname1=array();
    $prname1=$row35['p_name'];
  }
}

The problem is that I am not able to store the result of query to an array with comma separation. Please help me to store the result of a query to an array with comma separation

You are using deprecated database access functions. However I believe you are trying to do this

$prname1=array();
while($row35=  mysql_fetch_array($res35))
{
    $prname1[]=$row35['p_name'];
}
$string = implode(",", $prname1);