Search multiple colums in the same DB

Hi,
I want do develop a search form that can filter 4 different fields using PHP and MySQL. Let me explain:
The search form consists of 4 drop-down menus. The drop-downs comprise a group (a group is 4 categories, Province, City, Accommodation type and price range). I want the user to select his criteria from the 4 menus on the same page (Let's say he chose Province:Gauteng, City:Pretoria, Accommodation type:Hotel, Price Range:R501-R1000), then when he clicks on search, the results page must show the results as per his criteria, i.e Only hotels in the Province Gauteng, the city Pretoria and within a price range of R501-R1000.
Please anybody who can advise me on how to do this, I will be forever grateful. Hope I'm making sense.

Hi thanks for the reply. I Understand what you mean, but how do I implement it? I know too little about PHP and MySQL.
I got the below code- Is it any good for what I want to do? Please advise me on how to do this properly.
$term = "";
    $sql = "SELECT *, MATCH(province, near_city, accomm_type, norm_price_range) AGAINST('". $term ."') FROM lastminuteconfirm WHERE MATCH (province, near_city, accomm_type, norm_price_range) AGAINST('". $term ."') ORDER BY near_city DESC";
    $query = mysql_query($sql);
     while($result = mysql_fetch_assoc($query)) {
      echo("{$result['near_city']} - {$result['score']}");
Thanks,
Reandré

Similar Messages

  • Is it possible to search for multiple folders with the same name and...

    Is it possible to search for multiple folders with the same name and then select them all and change the permissions on just those folders .i.e. Search for the budget folders in all client folders and lock them down to just the project managers. Without having to go to each folder and apply the permissions.

    user11919409 wrote:
    Is it possible to create a Clone database with the same name of source db using RMAN ...
    yes
    >
    DB version is 11.2.0.2
    Is it possible to clone a 11.2.0.2 database to 11.2.0.3 home location directly on a new server . If it starts in a upgrade mode , it is ok ....yes
    Handle:     user11919409
    Status Level:     Newbie (10)
    Registered:     Dec 7, 2009
    Total Posts:     102
    Total Questions:     28 (22 unresolved)
    why do you waste time here when you rarely get any answers to your questions?

  • Search in Mail yields multiple versions of the same email

    I wasn't able to find any other postings on this, but this has been bugging me for a while now . . . just not big enough of a deal to do anything about. Whenever I do a search in Mail, the results give me multiple versions of the same email, in different stages of completeness. Is there some setting that I have inadvertently turned on that keeps back ups of my draft emails every few seconds? Anyone else have this annoying problem?

    I too am having this problem. Doesn't seem to happen all the time though. No rhyme nor reason ? I am using an IMAP account if this helps ?
    Message was edited by: Visioneer

  • Searching mail shows multiple copies of the same email

    I use gmail through Mail, and I noticed there are multiple copies of the same e-mail (on further inspection, it looks like the copies are at different stages/edits) show up in my Trash folder. Is there any way to stop this?

    The same thing just happened in my Blackberry gmail folder... I sent an email from my computer and 20 copies showed up on my phone.

  • Solaris 11 IPS:  How do you post multiple versions of the same package?

    How do you post multiple versions of the same software package on a single IPS instance(port)? Oracle was able to do it here with versions 151 and 175 of S11:
    http://pkg.oracle.com/solaris/release/
    Unfortunately, based on my searches, no where in the documentation (http://www.oracle.com/technetwork/server-storage/solaris11/technologies/ips-323421.html) does it explain to the development community how this is done. The best I can do is create pkg repo instances on different ports to host each different software version.
    We are trying to deploy an IPS repository for our drivers and utilities that our customers can link to and pull updates from. We have been able to post a software package to the repository using the command:
    pkgsend publish -s http://localhost:1234 -d ./ Appv1.p5m
    This posts the package on the IPS repository instance at port 1234 on the server. However, we would like to post multiple versions of the package on the server at the same URL. Why the same URL? So that our customers and end-users need only point to a single URL to pull down our software rather than having to add a new URL to the publisher list each time we have an update. We want at least 5 of the previous software versions to be available on the server. Posting each version of the application or driver on a different IPS instance on a different port will require customers to add multiple URLs to their publisher list and they also will not be able to initiate remote scans for updates.
    Has anybody been able to do this? Is any documentation forthcoming?
    Edited by: user13489824 on Jun 25, 2012 10:17 AM

    dhduvall: Thanks for your response. Yes, one would think that as long as the version numbers are different, you should be able to accumulate multiple versions of a package in a repository. It looks like Oracle has done it in their S11 repository unfortunately, as far as I know, they have not shared the steps on how to do this. I would like to publish two versions of the same package. I.E. two different manifests with two different fmri.pkg version strings and two different binaries.
    If I publish one package after another like this:
    pkgsend publish -s http://localhost:1234 Appv1.p5m
    pkgsend publish -s http://localhost:1234 Appv2.p5m
    Then only the second package shows up in the repository, as if it over-wrote the first one.
    Running pkgsend with two manifest, like this:
    pkgsend publish -s http://localhost:1234 Appv1.p5m Appv2.p5m
    Will cause pkgsend to combine the packages and manifests as if they were a single package... not what I am trying to do.
    Both approaches are complete without errors but neither achieves what I am trying to do.
    alan.pae: Thank you. Unfortunately, the link didn't really help. I've read Oracle's white papers and IPS developer guide so I'm familiar with the topics covered.
    Lex: Yes, I know. I specified the versions in the pkg.fmri value string.

  • A few days ago my TV show and movie displays went whacky-the shows are no longer in alpha order, there are multiple listings of the same show, the pictures are random-including album covers.  I downloaded latest version.  Any ideas??

    A few days ago my TV show and movie displays went whacky-the shows are no longer in alpha order, there are multiple listings of the same show, the pictures are random-including album covers.  I downloaded latest version & no change.  Any ideas??

    ME TOO.
    I think mine are all still in alphabetical order, but :
    * movies I deleted from my library and told "hide this purchase in the cloud" are showing up again. If I try to play them, I get the "cannot find the file in its proper location, would you like to locate it" error message.
    * for movies that have "iTunes Extras," the extras show up as a separate item, with another copy of the movie artwork. Most of these I believe I had DELETED the "iTunes Extras" anyway.
    * Items are showing up multiple times.
    * A few MUSIC ALBUMS are listed in my Movies section.
    * Some movies (I believe ones that I deleted off my HD but are still in the cloud) are showing random album covers instead of their proper artwork.
    * Just rented a movie, and it didn't show up anywhere in my library. It downloaded properly and completely, was in a suitably labeled folder in my iTunes/Media/Movies section, but didn't show up in any section of the library (or via a library search). Had to manually find it and tell it to open the file using iTunes.
    Running the latest version, even checked for updates. No other changes made lately since the last round of apple software updates. This was wonky before the latest small update to iTunes - now it's even wonkier. And it is very, VERY effing annoying.

  • Stop opening multiple instances of the same application

    I am used to having graphic files on my desktop, when editing one I would simply right-click and pick "open with" > Photoshop (which is always open in its own desktop in my computer). Now out of the blue, if I do that, it loads another instance of Photoshop, which is certainly what I don't want. I can have 2, 3, 4 Photoshops running at the same time and editing the same image!
    Any idea how to solve this? I searched but all I could find is people wanting the opposite i.e. opening multiple instances of the same app.

    Your best bet to prevent this is to detach or unmount this drive; however, you can also try resetting your Mac's launch services, to have it re-scan only the Applications folders on your boot drive for programs to associate with documents and services you are using. Running the following command in the OS X Terminal will kill the current launch services database (its long, but copy and paste the entire line):
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill
    Following this, run the following command to seed the database with the apps you currently have installed:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -seed
    Note that these changes will only apply when opening documents that have not been specifically assigned to a program. If you find a specific document continues to open the program on the external drive, then you can get info on it and change the associated program in the "Open With" section of the info window. After doing this, you might need to re-run these commands above, as opening the program will register it with OS X's launch services and have it now be available for automatically handling other documents.

  • Multiple copies of the same picture

    I am using iPhoto 8 with OS X 10.5.3. I have very little HD space available and need to clean up a very messy iPhoto library. I began by opening iPhoto and finding multiple duplicates of the same photos. I moved them to the TRASH and deleted them within iPhoto. However, when I reopen iPhoto, they are still there. When I use spotlight to look for where the copies are I will find them in a variety of locations: iPhotoLibrary/Originals or iPhotoLibrary/Data, or in iPhotoLibrary/(a folder that I made up, for example, a year the picture was taken. I want to trash all the duplicates, but I am not sure what the best way is to find the duplicates and then to select which one to keep.

    To add a twist to Terence's directions on getting just your original files out and imported into a new library. Open the library and COPY the Originals folder out of the library. Open the Originals folder and do a search of it (Command-F) and search for images less than 1MB. Drag those found to the Trash in the dock.
    Now launch iPhoto with the Option key depressed and, when asked, select Create a new library. When it's open drag the Original folder sans smaller files into the open iPhoto window. This will give you the same Events that you had in your earlier library. Might save you some organizational effort. Good luck.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.≤br>
    Note: There now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • Multiple copies of the same podcast?

    Why do I get multiple copies of the same podcast with different episodes in iTunes?  Is there a way of merging them into a single
    podcast?  On my iMac, I may delete some episodes and add others.  When syncing with my iPhone, a new podcast is created rather
    than updating the existing podcast.  At times, I've ended up with four different podcasts of the same program and finding a specific episode
    means searching thru all four. 

    I have been experiencing the same problem, and unfortunately sanfranciscotx's suggestion doesn't address or resolve the issue.
    iTunes is behaving inconsistently.  There are podcasts for which I have selected the "Download All" option and it only downloads new podcasts that have been released since the last time it was checked, regardless of how many podcasts were released in that time, without downloading old podcasts.
    In another case, the "Download All" option is selected, and it works as I would expect (the above scenario) for some time, but then one week it will start downloading a bunch of older podcasts as the original poster has mentioned.
    I am running iTunes 10.5.3, so I'm lead to believe the issue lies with the server where the podcasts are stored or the podcast feed and not with iTunes.

  • Multiple HighlightPainters for the same JEditorPane

    Hey Everyone,
    I'm having a problem having highligts of multiple colors for the same text component.
    Basically I have a set of results in a separate panel for a search on the text in a JEditorPane. I want the text corresponding to all the search results to be highlighted one color as soon as the search is done, and when one specific search result is clicked on, have the highlight for that result's text change to a different color.
    My current implementation is trying to do this by setting highlights for all the search results, and then when a result is clicked on, setting another highlight with another highlight painter of a different color. Unfortunately, this causes only the second higlight color to be displayed, even though when I look at the editorpane's highlights i can see all of them are being stored.
    Is there something I'm misunderstanding about Highlights?
    Thanks for any help,
    Phil.

    This example shows some ways of playing with attributes and highlights:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    public class TextPaneAttributes extends JFrame
         JTextPane textPane;
         JScrollPane scrollPane;
         Highlighter.HighlightPainter cyanPainter;
         Highlighter.HighlightPainter redPainter;
         public TextPaneAttributes()
              textPane = new JTextPane();
              textPane.setMargin( new Insets(20, 20, 20, 20) );
              StyledDocument doc = textPane.getStyledDocument();
              DefaultHighlighter highlighter = (DefaultHighlighter)textPane.getHighlighter();
              cyanPainter = new DefaultHighlighter.DefaultHighlightPainter( Color.cyan );
              redPainter = new DefaultHighlighter.DefaultHighlightPainter( Color.red );
              //  Set alignment to be centered for all paragraphs
              MutableAttributeSet standard = new SimpleAttributeSet();
              StyleConstants.setAlignment(standard, StyleConstants.ALIGN_CENTER);
              doc.setParagraphAttributes(0, 0, standard, true);
              //  Define a keyword attribute
              MutableAttributeSet keyWord = new SimpleAttributeSet();
              StyleConstants.setForeground(keyWord, Color.red);
              StyleConstants.setFontSize(keyWord, 24);
              StyleConstants.setStrikeThrough(keyWord, true);
              //  Define superscript attribute
              MutableAttributeSet superscript = new SimpleAttributeSet();
              StyleConstants.setSuperscript(superscript, true);
              //  Add initial text
              textPane.setText( "one\ntwo\nthree \nfour\nfive\nsix\nseven\neight\n" );
              //  Change attributes on some keywords
              doc.setCharacterAttributes(0, 3, keyWord, false);
              doc.setCharacterAttributes(20, 4, keyWord, false);
              //  Highlight some text
              try
                   textPane.getHighlighter().addHighlight( 4, 7, cyanPainter );
                   textPane.getHighlighter().addHighlight( 25, 28, cyanPainter );
                   textPane.getHighlighter().addHighlight( 35, 40, cyanPainter );
                   textPane.getHighlighter().addHighlight( 15, 20, redPainter );
              catch(BadLocationException ble) {}
              //  Add some text
              try
                   doc.insertString(0, "Start of text\n", null );
                   doc.insertString(doc.getLength(), "End of text\n", keyWord );
                   doc.insertString(doc.getLength(), "2", null );
                   doc.insertString(doc.getLength(), "1", superscript );
              catch(Exception e) {}
              //  Add text pane to frame
              scrollPane = new JScrollPane( textPane );
              scrollPane.setPreferredSize( new Dimension( 200, 200 ) );
    //          scrollPane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
              getContentPane().add( scrollPane );
              //  Create a Button panel
              JPanel buttons = new JPanel();
              getContentPane().add(buttons, BorderLayout.SOUTH);
              //  Add a Bold button
              JButton bold = new JButton( new StyledEditorKit.BoldAction() );
              buttons.add( bold );
              //  Add Right Alignment button
              JButton right = new JButton( new StyledEditorKit.AlignmentAction("Align Right", StyleConstants.ALIGN_RIGHT) );
              buttons.add( right );
              //  Add Remove Highlight button
              JButton remove = new JButton("Remove Highlight");
              buttons.add( remove );
              remove.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        int offset = textPane.getSelectionStart();
                        Highlighter.Highlight[] highlights = textPane.getHighlighter().getHighlights();
                        for (int i = 0; i < highlights.length; i++)
                             Highlighter.Highlight h = highlights;
                             DefaultHighlighter.DefaultHighlightPainter thePainter =
                                  (DefaultHighlighter.DefaultHighlightPainter)h.getPainter();
                             if (offset >= h.getStartOffset()
                             && offset <= h.getEndOffset())
                                  textPane.getHighlighter().removeHighlight(h);
         public static void main(String[] args)
              TextPaneAttributes frame = new TextPaneAttributes();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible(true);

  • Multiple instances of the same BSP app for the same user

    Hi,
    I currently have a BSP application which has a main page which consists of three frames.  Each of the frames within the page is linked to its own controller, with one other controller controlling the whole page.
    due to the nature of the program i need to access information from one controller in another.  To do this I create a reference to the controller whose data I want within the controller that needs access to it.  This works fine under normal processing, however when the application is executed / called up twice by the same user, the controllers for the initial instance of the application are de-referenced...
    Does anybody know why this may be occurring...and how to get around it?
    Thanks
    Mike Law.

    Whenever you open a browser anew, then there is no session data that the browser can send in any way whatsoever, therefor a new session on the server is started.
    If you open a new window from within the first session this might not be the case, you can run multiple windows in the same session.
    Either way, I would recommend to search the forum, there have been discussion about this (or a similar) topic, e.g. accessing the same model instance - it would be best if you look for them, read them, and if you have any questions left come back for more
    Cheers,
    Max

  • Can I view multiple sheets at the same time?

    My search fu hasn't been up to finding how, or if it is possible, to view multiple sheets of the same document at the same time. Can it be done? Either a split view in a single window or multiple windows would be fine.

    marchyman wrote:
    Thanks for the answer. Another workaround is to copy the table that I'm interested in and move it to the sheet where I want to see it. When done I can copy it back or delete it. Just seems like extra effort for something that should be built in.
    No need to copy the sheet. You could just drag it to the sheet where you want to see it, and when done, drag it back 'home'. (This can be done using the icons in the sidebar.)
    Caution: Changing to this method will require vigilance on your part to prevent accidently deleting the table instead of moving it. frequent Saves are recommended.
    Regards,
    Barry

  • Multiple panels of the same vi

    I want to run a VI multiple times at the same time (in parallel).
    That works in principle (dynamicaly load and run it in reentrant mode).
    But I never get multiple copies of the frontpanel of that VI.
    I tried several things, but I saw only one frontpanel of all the instances I started.
    How can I do that ??

    To dynamically create VIs with front panels you need to clone the VI. VI cloning can be done in many different ways, but if you want to build an executable of the code the attached example works very nicely.
    Just unzip the archive as it is and open and run main.vi in the llb file, then hit the new graph button to create clones of a VI displaying a graph of data controlled from main.vi.
    In this case I clone the VI by making copies of a VI that is included together with the llb/executable (when distributed I normally remove the diagramme of the VI), and I share data using a VI global.
    Another approach is to call a VI template instead of copying, and set the start value of the controls using VI server functionality, you can probably find more info about
    that if you search for VI cloning or cloning front panels.
    VI cloning is very useful even if the VI is not going to show a front panel; if you make a client-server solution and want each client session to be handled in parallel make a session handler, clone it for each connection and pass the connection handle to the clones by putting them in a list together with the name of the clone to handle that connection...The clone searches through the list, finds the connection and starts handling the commands from the client.
    MTO
    Attachments:
    VICloning.zip ‏52 KB

  • Error 1127 occurred when open multiple instances of the same LabVIEW top level VI?

    I try to open multiple instances of the same LabVIEW top level VI, After search some messages in the forum,I know it should use vi template, But error 1127 still occurred when i used template(In my program, Click menu file->new). The information about error 1127 is  "Cannot instantiate template VI because it is already in memory".
    Here is my code. can any one help me? Thanks.
    Attachments:
    test.zip ‏13 KB

    Hi,
    You are trying to obtain a path from the VI location but the VI has no location because its an instance of the VIT and therefore the path is <not a path>.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Is it possible to upload multiple files at the same time?

    Hi folks,
    It seems pretty trivial to implement a file upload item, but is there some way to allow selection (upload) of multiple files at the same time? Seems like this has probably come up before, but I didn't find much for solutions in my search. Any links or insight would be appreciated.
    Thanks!
    -Adam vonNieda

    Thank you both for your replies.
    @Manish - That does allow for multiple file uploads without refreshing the page, but does not allow for multiple file uploads at the same time.
    @Tony - That might be the way I end up going, although I probably should have been more specific. It would be really nice it there was a way to do a mutli-file select using the control or shift button like you can with a standard file selection dialog (if you want to copy multiple files, for example). Having a separate line for each file browser means there has to be a limit on the number that can be selected at the same time.
    Has anyone implemented a method of selecting multiple files at once, and hitting an upload button once to get them into the database?
    Thanks again Manish and Tony, very helpful.
    -Adam

Maybe you are looking for

  • Automated Row Process not inserting correctly??

    This is the first time I've gone through this, and if it worked I would be simply amazed. I have a button set to submit as INSERT. I have the checkbox checked inside my automated process allowing it to insert. I did move some thigns around, just orde

  • Random crashes when using USB drive with Creatie Suite

    I have a 24" Intel IMAC and when using a SanDisk Cruzer Titanium 2GB and Creative Suite I eperience random crashes in CS. When I remove th drive it works fine, any known issues when using Rosetta apps and USB drives? thanks

  • DVD cropped on some displays

    I created a 4:3 dvd menu and the dvd plays fine on some players and computers and gets cropped on others. How do I fix this problem so its not cropped on any dvd players? Examples: http://i39.photobucket.com/albums/e177/gagnefan4435/IMG_0939.jpg http

  • Deleting Calendars

    I have the Blackberry Tour.  I am at the end of my rope. I was using Google Calendar and Syncing just fine. All of a sudden, I have 3 calendars on my phone -- Device Default, and one for each of my e-mail accounts. Data is all over the place. I want

  • MAC Mini does not restart after Yosemite update

    I bought my MAC mini in 2011 and I successfully updated to Mavericks with no problems.  I am not sure why my MAC Mini will not restart after I updated to Yosemite. The completion bar gets stuck around 30%. Any help or ideas appreciated  Larry