Jump to content

CountryGirl

Members
  • Posts

    114
  • Joined

  • Last visited

    Never

Everything posted by CountryGirl

  1. Yes, I do need help in making it specific for my form. I'm not understanding how exactly to implement it. I have a while loop (as I've posted up above). But, I really don't understand how to tie in the multiple choice search form. Thank you for any help! No problem on the delay ! Qadoshyah
  2. Full text searching doesn't work too well with my database because of the way I need results to be returned. I tried a full text BOOLEAN search also. It doesn't return exact results like I need it to. Just because of the way full text searching works. Like If I searched "Smith, Tom" it's going to return his result, but also anything with the word Tom in it. I need exact results returned. That's why I think the multiple choice search form would be the best. But, so far, I can't figure out how to tie in the multiple choices! Qadoshyah
  3. Yes, I could. And I have done that. That has worked fine. But, when I try to add anymore OR statements to be able to search by let's say Parcel ID, the search starts slowing down and doesn't seem to work well. I have successfully done 4 OR statements, but after that, I can't add anymore in. They just take forever and never bring up the results page. Qadoshyah
  4. Okay, I'm messing around with trying to figure this out. I tried the following: WHERE $selectName = $search OR $selectName = $search OR $selectName = $search and also WHERE $selectName->Account = $search OR $selectName->OwnersName = $search OR $selectName->Legal = $search And my search form is modified to look like this: <tr><td><select name="selectName[]" size="3" multiple="multiple"> <option value="<?php echo $selectName->Account;?>">Account #</option> <option value="<?php echo $selectName->OwnersName;?>">Name</option> <option value="<?php echo $selectName->Legal;?>">Legal</option> But, that doesn't work. I get error messages back saying "Unknown column 'Array' in 'where clause':". Am I anywhere close to tying this search in? Do I need to add something to my code (I think I probably do, I just don't know what!). Thanks!! Qadoshyah
  5. Yes, I was doing that and it works, but what I'm having trouble with is tying in the 3 different choices to search by - account #, name & legal. They are in my search form, but how do I tie my PHP code to make it so that when someone selects "name" they can search by Smith, John. Or when someone selects "Account #", they can search by the proper account number. Thanks! Qadoshyah
  6. I guess it was off of something he did. But, it's confusing since I don't quite get what to do, because of the countries aspect. Qadoshyah
  7. Okay, so where would I add it in? Would I need to change anything in my code? Or just add his code and tweak it for my database? Qadoshyah
  8. Well, yeah, I was just realizing that as well with my while loop. I'd rather leave that while loop there, since it works well. So, my only question is, how to be able to search from the multiple choices in the search form and return accurate results. Do I just need to add somethings to the while loop? This is the page I'm working on and what I want to be able to let people select from: http://www.wagonerassessor.com/searchjoin3.php Thanks! Qadoshyah
  9. Yes, I'm still having troubles . I'm lost in PHP world right now . I realized that for some of the code/ideas given here, I need to have an array it appears - is that right? From reading up on how to create arrays, it appears I need to list everything in the database. I'm sure there's a way around this. How do I just create an array to one specific table and have the value be a wildcard or something like that? I tried adding some of the coding (and putting the information I need in it) that was suggested and putting it where I thought it needed to go, but it didn't work. I'm sure it was my fault, as I probably didn't have everything written right for it. This is my search form: <head><title>Searching Another Test</title> </head> <body bgcolor="#bba86d"> <div align="center"> <p></p> </div> <h1>Search Records</h1> <form method="post" action="searchjoin3.php"> <table width="90%" align="center"> <tr><td><select name="selectName[]" size="3" multiple="multiple"> <option value="one">Account #</option> <option value="two">Name</option> <option value="three">Legal</option> </select></td><td><input type=text name='search' size=60 maxlength=255></td></tr> <td><input type=submit value="Search Records"></td> </tr> </table> </form> And my PHP code: $search = $_POST['selectName']; if ($search) // perform search only if a string was entered. { $con = mysql_connect($dbHost, $dbUser, $dbPass) or die("Failed to connect to MySQL Server. Error: " . mysql_error()); mysql_select_db($dbDatabase) or die("Failed to connect to database {$dbDatabase}. Error: " . mysql_error()); $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, sale_parcel.SaleDate 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 INNER JOIN sale_parcel ON asmnt_parcel.Account=sale_parcel.Account ORDER BY asmnt_parcel.Account ASC"; $result = mysql_query($query, $con) or die(mysql_error().": $query"); And: 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"]; $sch = $r["TaxAreaCode"]; $sit = $r["Situs"]; $tship = $r["Township"]; $rng = $r["Range"]; $sctn = $r["Section"]; $date = $r["SaleDate"]; 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>$sch</td> <td>$sit</td> <td>$tship</td> <td>$rng</td> <td>$sctn</td> <td>$date</td> </tr>"; } // end while Well, looking more at my code . . . maybe I do have an array of sorts with the script above: "($r = mysql_fetch_array($result))." Where would I put a foreach statement in there to help tie it in? That's where I'm lost. Sorry if these are dumb questions, but I am quite new to PHP and am more confused than I thought I would be with this! Thanks for any more help from y'all! Qadoshyah
  10. I don't have any of my PHP code in an array, I think that's where my confusion/problem is. So, I'm trying to figure out the best way to write the arrays I need and then maybe the foreach and stuff you posted above will work better and make more sense. This is way more confusing than I thought it would be! But, I know this will be the most efficient way for my search to work. Thanks! Qadoshyah
  11. Thank you so much! I will work on my code and see how I can implement it well into my code. I think I can make it work. This will be a great reference to look at as I work on my code. I may come back with more questions tomorrow when I start working on my code, but we'll see. Maybe not . Thanks again! Qadoshyah
  12. I'm a little lost, especially when it comes to the foreach statements. Anymore advice/help you have would be great!! I've read over the code you posted a few times and am just not quite sure how to implement it all to my code. Thanks so much for the help! Qadoshyah
  13. Thank you so much! That'll be great!! I won't be working on the site I need this for all weekend anyways. So, when you get it trimmed down that will be awesome! I think it'll make much more sense once it's trimmed down. Thanks a ton! Qadoshyah
  14. Thank you so much!! That does give me some ideas. If you could post some snippets from that code of yours that would be great. I'm fairly new to PHP, so just the simple info doesn't always make sense to me (sorry, but I'm doing all this and learning PHP at the same time, haha!). Do I need multiple $_POST statements? I assume not, but just wanted to verify. For the WHERE clause, do I put all that information below in for each choice? foreach($_POST['selectName'] as $selectedName) ( $whereclause .= 'OR myfieldname = '.$seletedname; ) Thanks! Qadoshyah
  15. I'm trying to make a search form with multiple choices to be searched from. I want it to still return the same results from the same tables, just have someone be able to choose which criteria they want to search by. So, my question is, how do I tie in the multiple choices in the search form with the PHP code? I assume it would be put somewhere in the WHERE clause, but I'm not completely sure. This is my search form code: <h1>Search Records</h1> <form method="post" action="searchjoin3.php"> <table width=90% align=center> <tr><td><select name="selectName" size="3" multiple="multiple"> <option selected="selected" value="one">Account #</option> <option selected="selected" value="two">Name</option> <option selected="selected" value="three">Legal</option> </select></td><td><input type=text name='search' size=60 maxlength=255></td></tr> <td></td> <td><input type=submit value="Search Records"></td> And my PHP search 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, sale_parcel.SaleDate 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 INNER JOIN sale_parcel ON asmnt_parcel.Account=sale_parcel.Account WHERE asmnt_parcel.Account LIKE '{$search}' ORDER BY asmnt_parcel.Account ASC"; $result = mysql_query($query, $con) or die(mysql_error().": $query"); As you can see right now I just have the one search option in the WHERE clause. But, I need to change that obviously. Any tips and ideas on how to do it would be great!! Thank you! Qadoshyah
  16. Thanks! I tried using smallint and it doesn't work for the date column I tried it on. The date column I tried it on has to have the date like "1994-10-11." When I do smallint, it only gives the year. No day & month. Qadoshyah Thanks for the info! I will keep that in mind. Unfortunately, I have a decent amount of dates that go back before 1901. But, I will keep this in mind if I can use it for any dates. Qadoshyah If that is the case, then I'd recommend you use an unsigned smallint. Only requires 2 bytes, and you will not have any issue with range, as it allows values up to 64k.
  17. Thanks for the info! I will keep that in mind. Unfortunately, I have a decent amount of dates that go back before 1901. But, I will keep this in mind if I can use it for any dates. Qadoshyah
  18. 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
  19. Misread the OP. If its a year then why use double,? Why not just use INT if you're storing years. I'm not sure. I wasn't the one who loaded the information into the PHPMyAdmin. It seems to be working though now with the double 15,0. I may see if INT works better though. Thanks! Qadoshyah
  20. Thank you guys! That works . I'm getting all the tables fixed now! Qadoshyah
  21. "Type: double(15,5) Null: Yes Default: NULL" That's what it says. Thanks! Qadoshyah
  22. In several of the fields in my tables there are one too many 0's after the number. Like, say, there is a table that has a "YearBuilt" field in it. The year built is there, but after the year built, there are a bunch of extra zeros. Like this "1886.00000." Of course it comes through in the search results and obviously the company I'm working for doesn't like all the extra zeros. In the original microsoft access DB there are not extra zeros in those fields. It's just there in the PHPMyAdmin tables. How do I fix that and get rid of the extra zeros? Thanks! Qadoshyah
  23. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.