[resolved] Custom Form to Query Database (3 posts)

  1. Quin
    Posted 2 years ago #


    I want to create a form to query a table in the database.

    I was able to use standard PHP and SQL to get it to work, but the WordPress integration is something different.

    I am now able to pull the data from the table using $wpdb, but I do not know how to create a form so the user can search the table. The form I used simply took me to the site's home page and not return data.

  2. vtxyzzy
    Posted 2 years ago #

    Creating a form for a query is not a simple task. To illustrate, here is some sample code that creates a 'simple' form that allows a viewer to select a category and a sort order, then issues the query: http://wordpress.mcdspot.com/2012/09/21/simple-form-to-select-a-category-and-sort-order/

  3. Quin
    Posted 2 years ago #

    Well I managed to resolve the problem I had - it turns out it was rather straight forward once I knew how.
    I got the idea from a custom contact page tutorial (cannot remember the URL).

Topic Closed

This topic has been closed to new replies.

About this Topic