Support » How-To and Troubleshooting » To search WP database… send form where?

To search WP database… send form where?

  • Hi all,

    Absolute newbie trying to code. I’m trying to search my database based on a number of criteria where the user has selected from drop-down menus.

    To try to get it working I’ve cut the code back to searching for one criterion (difficulty) but I’ve realised I don’t know where to send it! I’d like to put “search.php” or similar after “action = ” but the file doesn’t exist and I don’t know how to create it.

    Any help appreciated!

    Draft code below:

    <form method=”post” action=””>
    <select name=”Difficulty”>
    <option value=”” selected=”selected”>-any-</option>
    <option value=”For_children”>For_children</option>
    <option value=”Easy”>Easy</option>
    <option value=”Medium”>Medium</option>
    <option value=”Hard”>Hard</option>
    <option value=”Very Hard”>Very Hard</option>
    <input type=”submit” value=”search”>


    global $wpdb;

    $result = MySQL_query(“SELECT * from Attributes WHERE Difficulty == ‘%$difficulty’

    echo $result


Viewing 1 replies (of 1 total)
  • I’ve also tried copying the form part of the above into a text file, zipping it and then importing it as a .php template, but get the error message:

    “The theme is missing the style.css stylesheet.”

    All help appreciated!


    – Daniel

Viewing 1 replies (of 1 total)
  • The topic ‘To search WP database… send form where?’ is closed to new replies.