• Hi,
    I try to search database via a form according to your code at; http://cfdbplugin.com/?page_id=680.
    I want to use one text input and two number input.
    When I use, one text input and one number input, it works properly.
    But when I use below code, it doesn’t work.

    <form action="" method="POST">
    name: <input type="text" name="name" />
    age1: <input type="number" name="age1" />
    age2: <input type="number" name="age2" />
    <input type="submit" />
    </form>
    [cfdb-datatable form="Günlük Yemek Adetleri" filter="name~~/.*$_POST(name).*/i&&age>$_POST(age1)&&age<$_POST(age2)"]

    ‘name’ and ‘age’ columns are exist at database.
    Is there a bug or I made some wrong?
    Thanks at advance for your help.
    Regards

    https://wordpress.org/plugins/contact-form-7-to-database-extension/

Viewing 1 replies (of 1 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    A couple issue there.

    1. It may be a problem in WP to have a post parameter “name”. Change
    name: <input type="text" name="name1" />
    to
    name: <input type="text" name="name1" />

    and the first part of your filter to:
    filter="name~~/.*$_POST(name1).*/i

    2. age<$_POST(age2) is a problem when the user fills in no value for age2. In that case the value is interpreted as zero i.e. age<0 which probably returns no results.

    This post walks through the issue of dealing with sometimes having no value in the input form.

Viewing 1 replies (of 1 total)
  • The topic ‘problem at searching database via a form’ is closed to new replies.