• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1450
  • Last Modified:

wordpress plugin base to show search form, query mysql and show result on a page


I need a simple plugin base code that:

- shows a search form (simple text input + submit button) on a page
- when submitted queries mysql db & does some stuff with retrieved data (Hello world text would be ok for the sample - I can manage the rest)
- shows the answer/results on the same page below the search form

It would be perfect if there would be a *shortcode* that can be inserted on pages - and where it is inserted the above search form / results would show

  • 3
  • 3
2 Solutions
What's wrong with the multitude of plugins that already exist or the built in search?
If you want a custom plugin then you would be better off hiring someone to do it for you.
We are here to answer questions.
netsltAuthor Commented:
I dont want to do a classical search for wordpress content.

I want to search a custom database and display the results.

I know how to do this in php, but would like to know how to integrate it into wordpress.

Just need a basic framework as described in my question to start from there.

So yes - it is a question: how do i integrate this into a wordpress page.

And yes, I know I can hire someone for this if I want  - but as I say I just need the basics to get me started quickly - the complex thing is the query & display of the results, already got that finished, just need to integrate it into a wordpress page.

GaryC123 thanks for your response, but it is not very helpful....
netsltAuthor Commented:
Maybe I missunderstood you: "multitude of plugins that already exist" - maybe you know a plugin that does something similar to what I want?

Then please name it... I could start from there.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

No because you omitted you were using a completely separate db.
What have you tried?
In WP you can use its own wpdb class to connect to the db
Your basic framework is not basic at all
netsltAuthor Commented:
I wrote "I want to search a custom database and display the results."

so custom database does not sound like the wordpress db.

also to query the db is not the problem.

The question is on how to show the search form, where to put the processing code & how show the results after processing.
Why don't you just take something like this

And amend the db connection and queries
Jason C. LevineNo oneCommented:
Technically, you don't even need to use a plugin for this.  Just create a new custom page template, add your form, search, and display code and then call that template as a new WordPress page.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now