• Dear reader(s),

    As a total newbie in WordPress and programming for that matter i have a problem which is driving me crazy (as in hours and hours of searching for a solution).

    The problem is as follow:

    With a plugin called Participant database i have created a wordpress database which stores different of field values (for example, colors, persons, pets). Users can, on one side, use forms to insert the data into the database but also, on the other side, search for data inputted data in the database. The plugin has a default search form (which, i guess, overrides the wordpress search form).

    Though, the thing i want to do is create a checkbox search instead of using the default search bar. I have seen many plugins with which it is possible to create checkbox search. Though, these all search for Taxonomy and/or Meta fields. This is where my total newbie skills come in, i have no clue what these terms mean / do (already tried to read up on it but still doesn’t make much sense).

    As far as i see now the searching with the checkboxes also only searches for posts instead of my inserted database fields (the colors, persons, pets, uploaded documents, etc.)

    So the question is, how can i create a checkbox searching which searches for fields in a specific database (table). I do actually have some minor knowledge in html/css (i know how to write the checkbox html) and even have some minor php knowledge (as in, i know how to write a query in php, connect to a database and do other simple stuff), though the wordpress setup is totally different with what i have done before, writing the queries and html from scratch. For example, at one point i decided to write the html for the checkbox and write the query myself but i have totally no clue where to write it.. So like i said, i’m a total newbie.

    I was hoping that anyone in here could give me some pointers / lead me in the right way.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello NicolasMous.
    We are on exactly the same boat or actually I am in the same boat you were 4 months ago. folowing your traces It seems that you found a problem on how to use participant database plugin and retrieve data using a search-box.
    you explained it in details for anyone in your case but I still I some problem reproducing it. I am so close! and am working of this for 4 to 5 weeks 8 to 10 hours a day (I am 70 and retired so I can spend ALL my time on this 7 days a week. I learn wordpress that I like very much (now)
    I need to finish ny website by the end of month and I was hoping you could me a bit. all help I asked from knowledgeable people only confused me more as they really think I know more than I really do, although I did big progress.
    I needed to update our website:
    that was REALLY primitive and needed a face lift.
    here is my new one,(in construction) with a temporay sub-domain awaiting to be ready.

    (click on the dog picture (left column) to see my search file.)
    WHAT I AM TRYING TODO
    I need visitors to find pet service providers within their own zipcode and performing one or several services. each of our 20 members (pet service provider) covers several zipcodes in Las Vegas and several specialities (so a multiple checkbox was needed.
    I contacted xnau from participant database who told me his search and sort form would not work for this purpose (as he did to you) and told me that I needed to make my own search form and adapt it so, being a newbie, I created one using coffeecup web-form-builder (HTML) on my PC. This part was easy and fun, I created a beautiful form. Unfortunately this $300 software does not send results on a wepage (apparently)
    after searching and searching I found a php code to replace the one generated by doffecup. it works !!!!

    My problem: the search form with checkbox and a drop down menu works very well BUT it return ALL data instead of the selected one!

    I am so close. I know that my code only mention
    $result = mysql_query("SELECT * FROM wp_uvmj_participants_database", $db);
    that return the full content of the database (only 3 participants so far to simplify)
    I know I need to add:
    WHERE ZIPCODE=$**** and WHERE specialties=$*** but I do not know how to adapt it. trying to modify it returns syntax error from mySQL5.5 and phpmyadmin 5.4

    this is the php code I have that returns all members regardless of request for the search form:

    <?php
     $db = mysql_connect("localhost","database_user","paswword");
     if (!$db) {
     die("Database connection failed miserably: " . mysql_error());
     }
    
     $db_select = mysql_select_db("database name",$db);
     if (!$db_select) {
     die("Database selection also failed miserably: " . mysql_error());
     }
    ?>
    
    <html>
     <head>
     <title>members</title>
     </head>
     <body>  
    
     IN CONSTRUCTION. TRY OUT ONLY<br/>
     please try later.than you
    
     This is the results according to your selection
     if you have any question please call us 702- 739-9591
     or email me [email protected]
    <div class="cssstyle">
     <?php
    
    <strong>$result = mysql_query("SELECT * FROM wp_uvmj_participants_database", $db);
     if (!$result) {
     die("Database query failed: " . mysql_error());
     }</strong>
    
     while ($row = mysql_fetch_array($result)) {
     echo "<h2>";
     echo $row[company]."";
     echo "</h2>";
     echo "<p>";
     echo $row[first_name];
    echo $row[specialty];
    echo $row[sub_category];
    echo $row[area];
    echo $row[photo];
    echo $row[bio];
    
      echo "</p>";
     }
    ?>
    </div>
     </body>
    </html>
    
    <?php
    //Step5
     mysql_close($db);
    ?>

    I marked in strong the part I beleive need attention
    our case is so similar , do you think you could help me?

    in return, if you need a fancy form I can create one (or more) for you for free. Creating a form with this software returns a folder containing the HTML, PHP, SFW,XML, CSS,swobject.js, and upload it to the server (or can be uploaded manually). so I could send you a folder you could simply upload in your server. The only file that need to be replaced is the PHP file that only upload data into the database and send email.
    NO SELECTED members on a web page

    the HTML page can be seen with the URL path to the containing folder or can be inserted within a wordpress page using <iframe> that is what I did on this page

    you can using the form to try, it does not affect anything, just returning a temporary list of members.

    IT SEEMS THE LINKS TO MY WEBSITE DO NOT WORK. I am trying again:
    https://snapps.riverviewproject.com/
    using the “link code”

    Thread Starter NicolasMous

    (@nicolasmous)

    Dear pierjeant,

    I’ve got my problem solved, though, I must note that it is pure html and PHP implemented in WordPress (so without all the WordPress styled PHP) and this might be bad practice. Nonetheless, it works!

    So up in front I must know the following:
    -You have access to the backend (you can reach your participant database files and your database – which is probably phpmyadmin or something)

    To see an example of my checkbox search database, go to the following site: portal.e-ucare.eu. There you can click on the Database tab.

    P.s. I am in an different timezone since I am from the Netherlands so replies might be a few hours later;)

    Regards,

    Nicolas

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Setting up an checkbox search for database fields’ is closed to new replies.