CountryGirl Posted February 1, 2010 Share Posted February 1, 2010 My search code is returning like 10 results for one item searched. And it's the same exact result. I understand if a certain item is in there multiple times for whatever reason, but that's not the case. It's returning the same results - duplicates - like 10 or more times in a row. On the same page. Why is it doing this? It was not doing this before! This is what I'm using for my search query: $query = "SELECT asmnt_parcel.Account, asmnt_parcel.OwnersName, asmnt_parcel.ParcelID, asmnt_parcel.Township, asmnt_parcel.Range, asmnt_parcel.Section, asmnt_parcel.LotSize, asmnt_parcel.LotSizeType, asmnt_parcel.TaxAreaCode, asmnt_parcel.TotalValue, asmnt_legal.Legal, cmn_name.Address2, cmn_name.City, cmn_name.State, cmn_name.ZipCode, asmnt_situs.Situs, appr_resident.TotalArea, appr_resident.YearBuilt, appr_miscimpr.Description, appr_miscimpr.Year, appr_miscimpr.Size, appr_miscimpr.Value, appr_commercial.CostValue, appr_commercial.BldgDescription, sale_parcel.SaleDate, sale_parcel.SalePrice, sale_parcel.InstrumentNumber FROM asmnt_parcel INNER JOIN asmnt_legal ON asmnt_parcel.Account=asmnt_legal.Account INNER JOIN cmn_name ON asmnt_parcel.OwnersName=cmn_name.OwnersName INNER JOIN asmnt_situs ON asmnt_parcel.Account=asmnt_situs.Account INNER JOIN appr_resident ON asmnt_parcel.Account=appr_resident.Account INNER JOIN appr_miscimpr ON asmnt_parcel.Account=appr_miscimpr.Account LEFT JOIN appr_commercial ON asmnt_parcel.Account=appr_commercial.Account LEFT JOIN sale_parcel ON asmnt_parcel.Account=sale_parcel.Account WHERE asmnt_parcel.Account = '{$search}' OR asmnt_parcel.OwnersName = '{$search}' OR asmnt_parcel.ParcelID = '{$search}' OR asmnt_legal.Legal = '{$search}' ORDER BY asmnt_parcel.Account ASC"; $result = mysql_query($query, $con) or die(mysql_error().": $query"); if ($result) { echo "Results:<br><br>"; echo "<table width=90% align=center border=1><tr> <td align=center bgcolor=#4A6B3F>Account</td> <td align=center bgcolor=#4A6B3F>Owners Name</td> <td align=center bgcolor=#4A6B3F>Address</td> <td align=center bgcolor=#4A6B3F>City</td> <td align=center bgcolor=#4A6B3F>State</td> <td align=center bgcolor=#4A6B3F>Zip Code</td> <td align=center bgcolor=#4A6B3F>Legal</td> <td align=center bgcolor=#4A6B3F>Parcel ID</td> <td align=center bgcolor=#4A6B3F>Property Size</td> <td align=center bgcolor=#4A6B3F>Type</td> <td align=center bgcolor=#4A6B3F>Total Sq. Ft</td> <td align=center bgcolor=#4A6B3F>Est. Year Built</td> <td align=center bgcolor=#4A6B3F>Total Value</td> <td align=center bgcolor=#4A6B3F>Impr. Description</td> <td align=center bgcolor=#4A6B3F>Impr. Year</td> <td align=center bgcolor=#4A6B3F>Impr. Size</td> <td align=center bgcolor=#4A6B3F>Impr. Value</td> <td align=center bgcolor=#4A6B3F>Cost Value</td> <td align=center bgcolor=#4A6B3F>Bldg. Description</td> <td align=center bgcolor=#4A6B3F>Sale Date</td> <td align=center bgcolor=#4A6B3F>Sale Price</td> <td align=center bgcolor=#4A6B3F>School District</td> <td align=center bgcolor=#4A6B3F>Situs</td> <td align=center bgcolor=#4A6B3F>Township</td> <td align=center bgcolor=#4A6B3F>Range</td> <td align=center bgcolor=#4A6B3F>Section</td> <td align=center bgcolor=#4A6B3F>Book & Page</td> <td align=center bgcolor=#4A6B3F></td> </tr>"; while ($r = mysql_fetch_array($result)) { // Begin while $act = $r["Account"]; $nme = $r["OwnersName"]; $add = $r["Address2"]; $city = $r["City"]; $ste = $r["State"]; $zip = $r["ZipCode"]; $legal = $r["Legal"]; $pid = $r["ParcelID"]; $size = $r["LotSize"]; $type = $r["LotSizeType"]; $sqft = $r["TotalArea"]; $built = $r["YearBuilt"]; $valu = $r["TotalValue"]; $impr = $r["Description"]; $iyr = $r["Year"]; $isze = $r["Size"]; $ivlu = $r["Value"]; $cost = $r["CostValue"]; $bldg = $r["BldgDescription"]; $date = $r["SaleDate"]; $pric = $r["SalePrice"]; $sch = $r["TaxAreaCode"]; $situ = $r["Situs"]; $tship = $r["Township"]; $rng = $r["Range"]; $sct = $r["Section"]; $inum = $r["InstrumentNumber"]; echo "<tr> <td>$act</td> <td>$nme</td> <td>$add</td> <td>$city</td> <td>$ste</td> <td>$zip</td> <td>$legal</td> <td>$pid</td> <td>$size</td> <td>$type</td> <td>$sqft</td> <td>$built</td> <td>$valu</td> <td>$impr</td> <td>$iyr</td> <td>$isze</td> <td>$ivlu</td> <td>$cost</td> <td>$bldg</td> <td>$date</td> <td>$pric</td> <td>$sch</td> <td>$situ</td> <td>$tship</td> <td>$rng</td> <td>$sct</td> <td>$inum</td> </tr>"; } // end while echo "</table>"; You can see what I'm talking about at: http://www.wagonerassessor.com/searchjoin2.php. An example you can search by "730000008." Thanks! Qadoshyah Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted February 1, 2010 Share Posted February 1, 2010 They're not the same results. SaleDate, SalePrice and Book & Page are different. Just a guess but I'd say you have multiple entries in sale_parcel for each account. Quote Link to comment Share on other sites More sharing options...
CountryGirl Posted February 1, 2010 Author Share Posted February 1, 2010 They're not the same results. SaleDate, SalePrice and Book & Page are different. Just a guess but I'd say you have multiple entries in sale_parcel for each account. Yes, I know that. But, it still duplicates the entries like 4 times. There are, let's say 4 or 5 different entries for that account, but then those 4 or 5 different entries are duplicated 2 or 3 times each. Why is it doing that?! Qadoshyah Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.