this is my code. i want to echo both name and family service provider and customer together by fetching from one database, first by fetching name and family service_provider and then by fetching name and family customer.
  <?php
$id=$fgmembersite->UserID(); 
/* echo "$id"; */
$db_host = 'localhost';
$db_name= 'site';
$db_table= 'action';
$db_user = 'root';
$db_pass = '';
$con = mysql_connect($db_host,$db_user,$db_pass) or die("خطا در اتصال به پايگاه داده");
$selected=mysql_select_db($db_name, $con) or die("خطا در انتخاب پايگاه داده");
mysql_query("SET CHARACTER SET  utf8");
$dbresult=mysql_query("SELECT tablesite.name as service_name,
                              tablesite.family as service_family,
                              tablesite.username,
                              tablesite.phone_number,
                              tablesite.email,
                              action.service_provider_comment,
                              action.customer_comment,
                              action.price,
                              action.date,
                              job_list.job_name,
                              action.ind
                       FROM  $db_table
                       INNER JOIN job_list
                       on job_list.job_id=action.job_id 
                       INNER JOIN tablesite
                       on tablesite.id_user=action.service_provider_id
                       WHERE vote!=''
                       
                       UNION
                       
                   
                       SELECT tablesite.name as customer_name,
                              tablesite.family as customer_family
                       FROM  $db_table
                       INNER JOIN job_list
                       on job_list.job_id=action.job_id 
                       INNER JOIN tablesite
                       on tablesite.id_user=action.customer_id
                       WHERE vote!=''",$con);                      
                       
   $i = 1;
                               
                       while($amch=mysql_fetch_assoc($dbresult))
{?>
  <?php
echo "<form id='form_$i' method='post' action='{$_SERVER['PHP_SELF']}' accept-charset='UTF-8'>\r\n";
echo'<div dir="rtl">';
echo "نام خدمت دهنده: "."   ".$amch["service_name"]." ".$amch["service_family"]."   "."شماره تماس: ".$amch["phone_number"]."   "."ایمیل: ".$amch["email"].'<br>'.
"شغل انجام شده: ".$amch["job_name"].'<br>'
."تاریخ انجام عملیات: ".$amch["date"].'<br>'
."هزینه ی کار: ".$amch["price"]." تومان".'<br>'
."توضیحات خدمت دهنده".'<br>'."- ".$amch["service_provider_comment"].'<br>';
echo "نام خدمت گیرنده: ".$amch["customer_name"].$amch["customer_family"];
echo "پاسخ خدمت گیرنده".'<br>'."- ".$amch["customer_comment"].'<hr/>';
}
?>
            
</fieldset>
after running this code i have this problem:
( ! ) Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\wamp\www\source\JobList.php on line 250
table action:
part of table action that has information of service provider
SELECT tablesite.name as 'service_name',
                              tablesite.family as 'service_family',
                              tablesite.username,
                              tablesite.phone_number,
                              tablesite.email,
                              action.service_provider_comment,
                              action.customer_comment,
                              action.price,
                              action.date,
                              job_list.job_name,
                              action.ind
                       FROM  $db_table
                       INNER JOIN job_list
                       on job_list.job_id=action.job_id 
                       INNER JOIN tablesite
                       on tablesite.id_user=action.service_provider_id
                       WHERE vote!=''
part of table action that has information about customer:
SELECT tablesite.name as 'customer_name',
                              tablesite.family as 'customer_family'
                       FROM  action
                       INNER JOIN job_list
                       on job_list.job_id=action.job_id 
                       INNER JOIN tablesite
                       on tablesite.id_user=action.customer_id
                       WHERE vote!=''



 
    