• zagga50

    (@zagga50)


    Theme: Meeta by WPZoom
    I am tryig to get a new site up and running for a dog breed association.
    I have added a custom table to WP containing the details of several thousand dogs.
    I want members to be able to search the db on multiple criteria (name, age, sex, health etc).

    I created an empty page referencing a custom template containing a simple “SELECT * FROM dogs”; using the WPDB class, which worked fine.

    I then inserted an HTML form to accept the search criteria:
    <form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">

    The procedure doesn’t seem to wait for user input with submit but runs straight through and displays all db records.

    Any suggestions gratefully accepted

Viewing 1 replies (of 1 total)
  • Thread Starter zagga50

    (@zagga50)

    PS I tested the procedure (replacing WPDB by PDO query) outside of WP and it waits for the Submit before proceeding to run the query.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom template with form to query custom table’ is closed to new replies.