Duplicating return records?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am having a very strange problem with the function below. It creates a
comma delimited list of property owner names and address. It could return
several thousand results. The problem I am having is that it displays the
correct name and address for the first 650 or so results and then returns
duplicate name and addresses for the next 650 or so and then back to the
correct name and address for about another 650. Any Ideas at why this might
be happening?

Example of correct name and addresses:
LINDSAY SHARON ,8006-0625-10,1459 E 96TH ST ,BROOKLYN NY , ,11236
DELTONA CORPORATION ,8006-0625-11,8014 SW 135TH STREET RD ,OCALA FL ,
,344736807
GEDDES MICHAEL R ,8006-0625-12,28444 TALL GRASS DR ,WESLEY CHAPEL FL ,
,33543
FIVE POINTS TITLE SERVICES ,8006-0625-13,C/O BETH SMITH ,8014 SW 135TH
STREET ROAD ,OCALA FL ,344736807
WADE ANTHONY A & MARGARET M ,8006-0625-14,3007 ROCKVILLE LN ,ROYAL PALM
BEACH FL , ,33411
VILLARONGA ROBERTO G MOSCOSO ,8006-0625-15,PO BOX 361928 ,SAN JUAN PR

Example of duplicated name and addresses (note that the ID number is
changing, but the name and addresses are duplicated and this is not the way
the data is):
GRANT MARK S & LUISA E ,8006-0627-02,797 MARION OAKS LN ,OCALA FL , ,34473
GRANT MARK S & LUISA E ,8006-0627-03,797 MARION OAKS LN ,OCALA FL , ,34473
FIVE POINTS TITLE SERVICES ,8006-0627-04,C/O BETH SMITH ,8014 SW 135TH
STREET ROAD ,OCALA FL ,344736807
FIVE POINTS TITLE SERVICES ,8006-0627-05,C/O BETH SMITH ,8014 SW 135TH
STREET ROAD ,OCALA FL ,344736807
LOPEZ MANUEL & SOLOME CASTILLO,8006-0627-06,1871 W 7TH AVE APT 7A ,NEW YORK
NY , ,100262800
LOPEZ MANUEL & SOLOME CASTILLO,8006-0627-07,1871 W 7TH AVE APT 7A ,NEW YORK
NY
  function Label(){
global $search, $name, $roll, $rollyear, $rypart, $conn;
$dbname = 'MARION';
$user = 'OASIS';
$pass = 'OASISPWD';
$conn = odbc_connect( $dbname, $user, $pass );
$sql = "SELECT * FROM O$rollyear.MCSEARCH WHERE PARCEL LIKE '$name%' AND
CONF = ' ' AND ROLL = 1 AND STATUS = '0' AND SPEC_USE_CODE = ' ' ORDER BY
PARCEL WITH UR";
$result = odbc_exec($conn, $sql);
$x = 0;
print '<html>';
print '<head>';
print '<title>MCPA-Comma Delimited Data</title>';
print '</head>';
print '<body bgcolor="#FFFFFF">';
print "<a href=mcpaeng.php?SEARCHBY=LBL&name=$name&rollyear=$rollyear>";
print 'Click here for old style labels.</a>';
print '<pre>';
while (odbc_fetch_into($result, $rows)) {
$x++;
/* $rows[0] Altkey */
/* $rows[1] Roll */
/* $rows[2] Parcel */
$prlyear = substr($rollyear,1,3);
$sql = "SELECT * FROM O$rollyear.D27$prlyear WHERE ALTKEY = {$rows[0]}";
$r2 = odbc_exec($conn, $sql);
odbc_fetch_into($r2, $addr);
print str_pad($addr[1],30,' ');
print ',';
print str_pad($rows[2],12,' ');
print ',';
print str_pad($addr[2],30,' ');
print ',';
print str_pad($addr[3],30,' ');
print ',';
print str_pad($addr[4],30,' ');
print ',';
print str_pad($addr[5],10,' ');
print "\n";
flush();
ob_flush();
}
print '</pre>';
print '</body>';
print '</html>';
odbc_close($conn);
}
 Thanks,
 Lee Herbst

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux