<?
include "connect.php";
mysql_query("SET NAMES utf8",$c);
$sql3="Select * From prawat WHERE pra_date between '$start' and '$finish' order by pra_date desc";
$result3=mysql_db_query($dbname,$sql3);
echo"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"white\"><tr>";
$intRows = 0;
while($rs3=mysql_fetch_array($result3)) {
$intRows++;
echo "<td>";
$id3=$rs3[pra_id];
$date3=$rs3[pra_date];
$sql2="Select * From cheeparm Where parm_id='$id3' AND parm_no='1'";
$result2=mysql_db_query($dbname,$sql2);
while($rs2=mysql_fetch_array($result2)){
$id2=$rs2[parm_id];
$strSQL = "SELECT * FROM prawat where pra_id='$id2'";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
while($objResult = mysql_fetch_array($objQuery))
{