The following gives me the results of the array but not rolled up (grouped and summarized).
<?
include_once("logonpsql.inc");
include_once("logonemp.inc");
session_start();
$_SESSION['SESSION_UID'] = $_POST["user_id"];
$_SESSION['SESSION_PW'] = $_POST["passwd"];
$_SESSION['SESSION_PERIOD'] = $_POST['perend'];
$user_id = $_SESSION['SESSION_UID'];
$passwd = $_SESSION['SESSION_PW'];
$periodend = $_SESSION['SESSION_PERIOD'];
$ss_num = $_SESSION['SESSION_SSN'];
$mod_date = explode("/",$periodend);
$mod_date = $mod_date[2] . $mod_date[0] . $mod_date[1];
$connection = pg_connect ("host=$host dbname=$db user=$user
password=$pass");
if (!$connection)
{
die("Could not open connection to PostgreSQL");
}
$connect_soinc = odbc_connect("$sodb","$souser","$sopass");
if (!$connect_soinc)
{
die("Error in SOINC connection");
}
$connect_topllc = odbc_connect("$todb","$touser","$topass");
if (!$connect_topllc)
{
die("Error in TOPLLC connection");
}
?>
<?
$s_query1 = "SELECT UPCHKD.EMPLOYEE, UPCHKD.PEREND, UPCHKD.EARNDED, UPCHKD.HOURS, UPCHKD.ERATE, UPCHKD.EEXTEND, UPCHKD.TAXEARNS
FROM
soinc.UPEMPL UPEMPL LEFT JOIN soinc.UPCHKD UPCHKD ON
UPEMPL.EMPLOYEE = UPCHKD.EMPLOYEE
WHERE
UPEMPL.SSN = '$ss_num' AND
UPCHKD.PEREND = $mod_date";
$s_query2 = "SELECT COUNT(*)
FROM
soinc.UPEMPL
WHERE UPEMPL.SSN = '$ss_num' AND
UPEMPL.STATUS = 1";
$s_query3 = "SELECT UPEMPL.FIRSTNAME, UPEMPL.LASTNAME
FROM
soinc.UPEMPL
WHERE
UPEMPL.SSN = '$ss_num' AND
UPEMPL.STATUS = 1";
$s_result1 = odbc_exec($connect_soinc, $s_query1);
$s_result2 = odbc_exec($connect_soinc, $s_query2);
$s_result3 = odbc_exec($connect_soinc, $s_query3);
$s_count=(int)odbc_result($s_result2,1);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Online Paycheck</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" background="background2.gif">
<form name="SubMain" action="paycheck.php" method="post">
<table width="781" border="0" cellspacing="10" cellpadding="5">
<!--DWLayoutTable-->
<tr>
<td height="29" colspan="3" valign="top"><div align="center">
<?
echo "<strong>Paycheck Data for " . "$periodend</strong>";
?>
</div></td>
<td width="169"></td>
</tr>
<tr>
<td width="125" height="29" valign="top"><div align="left"><font face="Arial, Helvetica, sans-serif">Employee
Name:</font></div></td>
<td width="159" align="left" valign="top">
<?
if ($s_count > 0)
{
echo odbc_result($s_result3, 1);
echo odbc_result($s_result3, 2);
}
//else
//if ($t_count > 0)
//{
//echo odbc_result($t_result5, 10);
//}
?>
</td>
<td width="238"></td>
<td></td>
</tr>
<tr>
<td height="29" valign="top"><font face="Arial, Helvetica, sans-serif">Current
Earnings:</font></td>
<td align="left" valign="top">
<?
if ($s_count > 0)
{
$rows = odbc_result_all($s_result1);
}
?> </td>
<td></td>
<td></td>
</tr>
<tr>
<td height="475"> </td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</form>
</body>
</html>