Create the search function of price in php recordset object range

Hello

On a continuation of a previous thread, I find that the expertise of web designers on these forums turns much more educational and beneficial than the large number of books that I bought to set up a Web site for my real estate business. (Without seeming too subservient!).

I managed to create a working site where properties in my database and their related images are drawn in a recordset on the live Web page and everything works perfectly. However, I would like to add some simple filters on the search page to refine the results of the database.

I find that given a push or piece of coding I can work out the rest myself. Therefore, I would like to do is create a price range drop down, where customers can select the database properties in one of 3 categories: under £1 m, 1 m £-£2 m and more than 2 million pounds.

If I understand correctly, I need two pages to do this, a page of html form where customers will enter their search criteria with similar coding to:

< do action = "search_results.php' method ="post"name = 'Search' id ="Search">"

Price range:

< select name = "prop_price" id = "select8" >

< option value = "< 1000000" > > £ 1 000 000 < / option >

< option value = "1000000-2000000" > £ 1 000 000 - £2 000 000 < / option >

< option value = "> 2000000" > > £ 2 000 000 < / option >

< / select >

< input name = "Search" type = "submit" id = "Search" value = "Search" >

< / make >

(my apologies for my messy coding - I'm still new and do not know if some of the fields are not yet mandatory!).

Then, I would need to create the search_results.php page which would give the results of properties in the database according to the submitted price range. I tried several different methods available online through the forums, but can't seem to get anything after 2006, or everything that actually worked. I use Dreamweaver CS5 and MySQL to my db.

How to integrate the above search criteria in a dynamic php doc? The only way I managed to get something working is to create a new page for each of the variables price - something that is incredibly inefficient, and hardly something that can be developed easily move forward.

Here is the php code, I currently have which retrieves all the properties of my database (connection name is test, the name of the recordset object is getDetails):

<? php require_once('Connections/test.php');? >

<? PHP

If (! function_exists ("GetSQLValueString")) {}

function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

{

$theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

Switch ($theType) {}

case 'text ':

$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

break;

case "long":

case "int":

$theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

break;

case "double":

$theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

break;

case "date":

$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

break;

case "set":

$theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

break;

}

Return $theValue;

}

}

$maxRows_getDetails = 20;

$pageNum_getDetails = 0;

If (isset($_GET['pageNum_getDetails'])) {}

$pageNum_getDetails = $_GET ['pageNum_getDetails'];

}

$startRow_getDetails = $pageNum_getDetails * $maxRows_getDetails;

@mysql_select_db ($database_test, $test);

$query_getDetails = "SELECT id, prop_name, prop_price, country, post_code, short_desc, picture images FROM order by prop_price DESC";

$query_limit_getDetails = sprintf ("%s LIMIT %d, %d", $query_getDetails, $startRow_getDetails, $maxRows_getDetails);

$getDetails = mysql_query ($query_limit_getDetails, $test) or die (mysql_error ());

$row_getDetails = mysql_fetch_assoc ($getDetails);

If (isset($_GET['totalRows_getDetails'])) {}

$totalRows_getDetails = $_GET ['totalRows_getDetails'];

} else {}

$all_getDetails = mysql_query ($query_getDetails);

$totalRows_getDetails = mysql_num_rows ($all_getDetails);

}

$totalPages_getDetails = ceil($totalRows_getDetails/$maxRows_getDetails)-1;

? >

< table width = "990" border = "0" align = "center" cellpadding = "0" cellspacing = "0" >

< b >

< /tr >

<? PHP {? >}

< b >

< td > < img src = "show_image.php? id = <?" PHP echo $row_getDetails ['id'];? > ' > < table >.

< td > <? PHP echo $row_getDetails ["prop_name'];? > < table >

< td > <? PHP echo $row_getDetails ["prop_price"];? > < table >

< td > <? PHP echo $row_getDetails ["short_desc"];? > < table >

< /tr >

<? PHP} while ($row_getDetails = mysql_fetch_assoc ($getDetails));? >

< /table >

<? PHP

mysql_free_result ($getDetails);

? >

Essentially, I need to integrate the function WHERE my request sql, but how do I do so that it is dependent on the demand of customers on the search page...?

Sorry if this is incredibly easy, but I am at a complete loss now and can't try all the techniques of the various forums out there! I even downloaded the framework of Zen cart just to see if I could find something in the large number of php pages that goes with it!

I hope someone can help-

Thank you

Jack

Noba_arsene wrote:

OK, have updated

If the current Recordset does not work or not?

Please correct the elements of form, thus:

Price min

Price Max

can´t you use the same value of id/name with several elements of shape, because the motion of the recordset must unique variable names $_POST. Please rename the values of name/id like this:

Price min

1. When you set a property of "Studio", you actually store room 0 value in the database? If so, it s very well, but if it s a different value (or even no value at all, aka NULL) please let me know.

2. as mentioned in a previous post, you shouldn´t use the comparison operators in conjunction with the entire option values. Change the value to '> 4' with '5', which will be all you need to get this segment of our conditional query defined properly.

Tags: Dreamweaver

Similar Questions

  • Using Sessions php component to the search functionality in a non-login site

    Of course sessions are used for connection scenarios.  My question is, since in a web page that has the feature of research and where the public user does not connect. but rather, is simply a search on a database table by using the appropriate html search entry form and accompanying the php script. a php session component is used?  The user is connected to the database as part of the search function, so if a php session component is included in order to close this topic, assuming that the connection can be closed, using a session element, in this circumstance.  Or well, the connection is closed all just when the user moves to another web page?

    It seems for that database connection may remain open an excessive amount of time should the user not down the search page or a page of results.  Thanks in advance for any input.

    It seems for that database connection may remain open an excessive amount of time should the user not down the search page

    Not how it works. As soon as the script runs, the database connection is released. It doesn't matter if the user is still looking at the page.

    so include a component php session in order to close this topic

    Also no how it works

    For research, I use POST. You can also use GET.  Using SESSIONS would not normally make sense, since the variable SESSION must get populated by POST or GET data anyway.

    Sessions serve not only for the opening of the session. They are nice for shopping cart States peacekeeping because the user can leave the 'store' and go to other parts of the Web site and shopping cart data disappear.

    I uses sessions to keep track of the language that the user selects and other important variables. I also put the language in the url parameters, but store it in the SESSION table is a fallback measure.

    php session component

    Just to be clear, SESSIONS are not part of PHP, even though they are frequently used together. SESSION, POST and GET are all part of the server environment.

  • Windows Live Photo Gallery - how to increase the limit of tag 1010 people on the search function

    The search function in Windows Live Photo Gallery people tags seems to be an arbitrary limit of 1010 different tags (1000 in the alphabetical list + the 'Top 10'). Is there a way to get around this?

    When I used the Vista Photo Gallery and my tags 'people' were just a subset of 'descriptive' tags that I created, I could find just a name on the left panel. Not sure why it isn't a section he tags in the version of Windows Live people. If you put arbitrary limitations on the functionality of Visual search 'whizz bang', it would be nice if there was a relief when it does not work.
    Is return to the starting point - maybe somewhere where the limit is stored in the registry and it can be increased or an another workaround?

    There is a forum for Windows Live products. Since your questions deal specifically with the Windows Live Photo Gallery witith, please repost in the following forum. You can also search any suggestions or solutions.

    http://windowslivehelp.com/product.aspx?ProductID=20

    Sincerely,

    Marilyn

  • How can I fix the "search function"?

    Hello, I had problems. "Search" my function does not work correctly. When I search for words, he there did not highlight, doesn't appear as sort of a dotted rectangle. I tried everything, but I could not return to normal. How can I fix?  Thanks for the attention.

    Hello

    Please let me know now the search function works very well or not. Also if its with single document, please check with the name of the application by means of which the document was created originally.

    Kind regards

    Christian

  • Search function does not work correctly (it does not mark the words found, instead, he built a light blue frame); When you open the PDF with Foxit, the search function works.

    Hello

    I use a PC (not a MAC). The document that I have a problem with emerged on a Word Document. I opened it using Adobe Acrobat Reader DC.

    When I tried to search for a Word, it worked. He scored the first word matching my search. As I pressed Enter to get results, he built a clear blue frame around large parts of the text presenting the result somewhere in the framework:

    Suchfunktion_Adobe.png

    When more pressing enter, the frame moves to the right or expands, but no other match is found. I tried to open the same file with Foxit pdf and here the function works correctly (marking all the matches one by one).

    Unfortunately, I can't tell all my customers to use Foxit. They all use Adobe and are complained about the search function.

    The size of the document is 9,32 MB and contains 324 pages.

    Thanks in advance for your help.

    Yours,

    Ula

    Hi Sarah,.

    We've fixed the problem. Where a person has the same question:

    When you create a pdf file in Word (by "save under" and select 'PDF (*.pdf)' as the type of document)), you can click on the 'Options' button... "When you want to have a tree structure of your pdf file.

    In the 'Options' dialog box, select "Create bookmarks to help: ' (I so always use 'Headings') and UNCHECK"Document structure for accessibility tags '.

    Then you will have problems with the whitin your structured pdf search function.

    It's a problem with Word.

    Thanks for your time!

    Kind regards

    Ula

  • 1 - where is the search function to find the authors muse a list?

    1 - where is the search function to find the authors muse a list?

    Hello

    Regarding your first question of the creation of a search box in your site from muse, please see this forum post:- Re: how to create a search box in MUSE?

    In addition, you can use different widgets available on Adobe Exchange .

    Now, regarding your second please can question of the creation of a bulleted in Muse, you these tutorials:

    Adobe help Muse | Bullets and numbers

    Bullets and lists numbers | Adobe Muse CC tutorials

    Now, it seems that the Muse version you are using is obsolete and it is possible that you might not find these features in it. I would ask update you your Muse to the latest version 2014.2 using the CC desktop application to take advantage of all these features. Please refer to this screenshot:- http://prntscr.com/55uvs9

    Hope this helps

    Kind regards

    Rohit Nair

  • Settings for the search function?

    A user in the field examines the search function in CHM I provided with our software.  The CHM is created with RH8.

    1. is there a setting that will cause the returned page open at the first occurrence of the word/phrase search on?

    We maintain successive years of release notes in one of the CHMS, so a search may return many, many pages and these pages can be quite long.  When the term/phrase does not occur until the middle of the page, it would be very useful for the page to open right to this place.


    2. is there a setting that prevents "Ctl + F" the opening of a find dialog box?  It was my suggestion to the user as a workaround to #1.  It works perfectly for me, but not at all for him - the search box simply did not open.  It is possible that something unique to software program media CHM, but it could have been a computer setting?

    Is there a setting that will cause the returned page open at the first occurrence of the word/phrase search on?

    Not that I've never heard of.

    Is there a setting that prevents "Ctl + F' to open a find dialog box?

    Why do you want to turn off Ctrl F, surely that's what the user wants to find the word in the topic?

    See www.grainge.org for creating tips and RoboHelp

    @petergrainge

  • I lost the search function of the messages and the folder "sent" under my second email address.

    The search function to search for messages that were sent to me has disappeared. I also have to email addresses in thunderbird. One shows all my sent messages. But there is no option "sent" under my second email address

    Lost search engine? This sounds as if you've lost a toolbar, or have lost a tool in the toolbar. Whatever it is, hopefully that will help the following:

    http://chrisramsden.vfast.co.UK/5_Lost_toolbars.html

    Do you have anything sent "from" this second account yet?

    Check the following is all / selected:

    View | Records | All the

  • Version 30: I hit the star of bookmarks and the search function disappeared. In addition, b/brands list covers a portion of the tab... can we recover the research?

    FFox itself updated to version 30 - as happens unfortunately. So far, hit the bookmarks star opens a window on the left with a search engine on the top, and the following list of the bmarks. The search engine has now disappeared, and bmarks list covers the actual page, I am browsing...
    Can I pick up the search function? Maybe even put an end to bmarks list maskign who I am through?

    If not, what other browser good reputation can you recommend thus rid myself of this and all future destroyers "improvements"?
    Thank you

    You can install the extension Classic theme restaurant if you want a dedicated toolbar button to open the bookmarks bar.

    You can check the settings of the extension of the CTR through the Options/preferences button on the page "Firefox/tools > Modules > Extensions.

  • How can I remove the search function of Joobers of Firefox?

    I would like to remove the search function of my 8.0.1 Mac Joobers version of Firefox. This feature appeared all recently. I tried to remove the Joobers cookies and restart Firefox. Any other ideas?

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

    • Open the topic: config page through the address bar and do a search for joobers via the filter at the top of the about: config page.
    • Reset all the joobers related prefs which appear "BOLD" (user set) via the context menu to their default values.

    See also:

  • The 'Search' function on the start menu does not work. It seems to freeze and will not even close until I have shut down the computer. What can I do to correct this situation?

    I tried to use the "Search" function to locate a specific file.  The computer froze... not allow me to cancel when I realized that it wasn't working.  The only way I could get the closing of the window had to shut down the computer.

    Hi DyleAcker,
     
    -Search function work is no problem earlier?
     
    Run the troubleshooter from the link given below and if it helps to fix the problem:
  • Keep losing the search function

    The search function in Windows XP suddenly stopped working and it only perform a system restore got

    work again. The only change I had made in advance was to uninstall a redundant version of "Ad-Aware".

    my computer. A second attempt to uninstall the program had the same effect, having to make another

    System Restore to recover the search function.

    You can check 'services' via the administration tools.

    try to start (or restart) the windows search service and indexing service.

    DB·´¯'·.. ¸ >-))) º > ·´¯'·.. ¸ >-))) º > DatabaseBen, Retired Professional - Analyst - database developer - accounting - l'[email protected] veteran 'share nirvana mann' - dbZen ~ ~ ~ >

  • How can I make F3 does not bring up the search function

    I don't want windows to bring up the search function whenever I hit F3. How can I change the windows keyboard shortcuts so I can get him to stop?

    I; m do not know how in Vista, but the following program http://www.autohotkey.com/ claims to be able to remap existing keyboard keys and can help you remove the F3 function or at least let you change to another function.

    Here is another free software that claims to be able to do the same: http://www.frkeys.com/doc/edit_keyboard_shortcuts.html.

    I'm not sure that these programs actually work with the F3 hotkey and since they are 3 third party programs, use you them at your own risk.  I suggest the creation of a restore systemm point and back up the registry before you try both methods to be on the safe side.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to fix the search function in Windows 7

    I just bought a new HP laptop with Windows 7 64 bit and am ready to throw it out the window.  The search function is the worst.  He is unable to find files containing search terms - only discovered the files whose file NAMES containing the search terms.  It does not define the search parameters as did Windows XP.  How can I keep/use the search function of Windows XP?  Y at - it a patch?  A fix?  An add-on software that I can use?  Microsoft warns that if you try to uninstall Windows 7 and try to install Windows XP, your computer may become "unusable".  Search results are inaccurate - I use it for work and I can't have a search function that does not work as XP did or get wrong results!  I've already indexed all of the computer and 2 sessions of chat with people from HP support.  Nada. I don't have to become a geek simply search my files.

    Hi Sylvia,.

    Please try management than fix the following:

    http://support.Microsoft.com/mats/windows_search/en-us

    Also, what antivirus do you use? We can't wait to hear back on your part.

  • That means MOSC (200 points - you tried the search function)?

    Hi, admins MOSC

    We find this statement in our activity log " 200 Points - you tried the search function .

    Please let know us what do you mean by this statement?

    Please check the attached screenshot.

    George

    Hi George,.

    It's simple: OTN or MOSC Jive reward you 200 points for the search function in the upper right corner. That's double for a correct answer...

    And you can get another 250 points (or 2 correct + 1 helpful answer) If you download a new image for your avatar. This is the mission "Let's Face It - you downloaded and put a custom avatar."

    But you get points only for the download, you should not use the new image.

    IMHO, some of the missions havn't none sense, in order to take the points and have a nice day.

    Brave new world

    Kay

Maybe you are looking for

  • Memory of dc7600 SFF

    Hello. This is what I am trying to accomplish. Got a renovated DC7600 SFF, equipped with a Pentium D 945 processor. He got 4 sticks of 512 MB installed between 4 banks (all PC2-5300). I would use 2 sticks in another pc running the same memory and rep

  • Tecra M2 - strange hard drive connector

    The connector to the HDD on a Tecra M2 I have here, it's not what I expected for an internal 2.5 drive ". I put a picture of him here: http://www.CIX.co.UK/~texaspete/hd_connector.jpg Anyone know what this connector, or where I can get the converter

  • E5-772 Acer Recovery Management not opening point 8.1 Windows

    Hello I tried to get rid of a hijacker rather bad for several weeks and after many attempts, try to remove such malware, support removal programs. I decided to reset my computer by default. When I tried to use recovery management, as long as I got la

  • TouchSmart 300

    It's my brother's PC. It took several years and recently upgraded to Win 8.1. When it turns on the normal HP screens come to the top and it starts at the sign in the interface. After entering the password hit enter, the screen turns black and does no

  • Loading data from the external XML file

    Hello people! I have a XML file on my server, updated by cron every 10 minutes and I want to load data to my webworks her application, but the jquery ajax function do not support the folded areas. So here's my question - how should this information?