Search page in wordpress to search mysql DB

Discussion in 'PHP' started by bellcom, Nov 19, 2013.

  1. #1
    Hope this is the right place, could have posted in wordpress section I guess since this for a wordpress page.

    I need to create a pages something like this:
    http://registry.faa.gov/aircraftinquiry/NNum_Results.aspx?NNumbertxt=346T

    I know how to create a form for the user to fill out to collect this info and then store in a mysql db.

    I don't know how to create page that will search the DB and then display the results.

    Are there any plugins that will help with something like this or do I need to hire someone to create a search page?

    I have a business directory plugin that I just bought that makes it easy to put up a form to collect listings data and a search page that would work like this but you can't create custom fields, just have to use the predefined fields. So maybe thought there would be another plugin that would allow custom fields?

    Any suggestions apprectiated!!
    Thanks!
     
    bellcom, Nov 19, 2013 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    What is it you need this search to do, specifically? WordPress have built in search functions that will search any page or post, or tag or category. There are also plenty of search plugins for WordPress.

    But, frankly, if you're that green when it comes to WordPress, you might consider hiring someone.
     
    PoPSiCLe, Nov 19, 2013 IP
  3. bellcom

    bellcom Well-Known Member

    Messages:
    220
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    120
    #3
    I had created a form that stores the data in a newly created db, not the same db that contains the wordpress db.
    It just stores the data but does not create a new post for each so I did not think that the wordpress search would work.

    I just need to be able to search the data by name, serial number or n-number and display the results.

    So even if I hire someone, is it better to have each entry created on a separate post or pages and use the wordpress search?
    Or since I already have the form & db setup, would it work just as well and perhaps less expensively if I just get someone to create the search page ?

    thanks!
     
    bellcom, Nov 19, 2013 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    You could probably just get someone to make a specific search on a WordPress page. That would probably be the quickest and cheapest.
    However, with a bit more work, you could get the input from the form to be a part of the WordPress content, and hence be able to manipulate the submitted content using WordPress' builtin functions for tagging, catergories etc.
     
    PoPSiCLe, Nov 19, 2013 IP
  5. sarahk

    sarahk iTamer Staff

    Messages:
    28,897
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #5
    If the search is quite specific - such as "search widgets" as opposed to "search the site" then having it separate is fine as users won't be confused about why they work differently.

    I'm intrigued that you saved them into a different database rather than just a different table in the same database but that's not a big issue.

    I've got a wp site that display rental price info for different NZ regions. We import that raw data in wp-admin and store it in it's own table.

    On the front end we have a "page" which introduces the "calculator" and has a shortcode on it.

    We then have a plugin that I've written that looks for the shortcode in a page and when found looks for any get data it can use, generates a graph and a new form to allow a new query. We've deliberately used get rather than post so that people can save and email the page. Setting up the form is reasonably fiddly and we want to make it easy for the data to be shared.

    Where we graph, you could just be displaying the relevant data in a table.

    Is that the sort of thing you are trying to acheive?
     
    sarahk, Nov 19, 2013 IP
  6. bellcom

    bellcom Well-Known Member

    Messages:
    220
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    120
    #6
    I didn't really have a reason for creating a separate database, I am just setting up & testing a new site.
    I know how to create form that saves into a db and just created a separate db to store the results.

    I have a few expensive form plugins like gravity forms that I believe let you create a form & save to the db so maybe I will experiment with that to see if its easier to use a wordpress search.

    However, the results are not going to be public, only the admin will use the search page with only 3 different search options so this is what I thought would be easiest.

    I have a few programmers since I am not good at and will get them to create a plugin or search page and see what they suggest but just wanted some other opinions.
    Thanks!!
     
    bellcom, Nov 19, 2013 IP
  7. bellcom

    bellcom Well-Known Member

    Messages:
    220
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    120
    #7
    I ended up finding a dreamweaver "form to database" extension that makes this real easy. It also creates a backend admin section where you can view, export, edit & search the data. Time to go learn some php :)
     
    bellcom, Nov 28, 2013 IP
  8. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #8
    Yeah. If the alternative is anything related to "dreamweaver", it's definitely time to go learn PHP :D
     
    PoPSiCLe, Nov 28, 2013 IP
    sarahk likes this.