Custom Bulk Options

Home Forums Quform WordPress Custom Bulk Options

This topic is: resolved
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2566
    mtupuschies
    Participant

    Hi,

    is there a way to add custom bulk options for the dropdown settings?
    I know there are a few already but I would not really need all of them. But I would need some other custom bulk options I would like to have in the settings.

    Where would I cange that? I guess they are somehow stored in a table?
    Or is it “just” a php file to edit?

    Thanks!

    #2570
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #2618
    lawrencepepper
    Participant

    Looking to do this but want my array to be populated with data from my database.

    Here is what I have so far for creating the array.


    <?php
    mysql_connect('localhost', 'xxxx', 'xxxx');
    mysql_select_db('qa');

    $query = mysql_query('SELECT company FROM qa_vendors ORDER BY company ASC');

    $result = mysql_query($query);

    $companies = array();

    while ($row = mysql_fetch_assoc($result)){
    $companies = $row['company'];
    }
    ?>

    How can I then get this array to be listed as a bulk option?

    Any help would be appreciated.

    #2625
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #2644
    lawrencepepper
    Participant

    I placed the code into my functions.php file and the Bulk Option does not show but it is not populating with the query. It is just blank.

    L

    #2645
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #2646
    lawrencepepper
    Participant

    Yes that worked.

    I tested this code on another page on the site and it works fine:


    mysql_connect('localhost', 'xxx', 'xxx');
    mysql_select_db('qa');
    $query = "SELECT * FROM qa_vendors";

    $result = mysql_query($query) or die(mysql_error());

    while($row = mysql_fetch_array($result)){
    echo $row['company'];
    echo "<br />";
    }

    It returns the list of companies from the table.

    How can I get this code to work.

    Thanks for the patience, I am new to PHP and am just learning. I have a strong background in CFM so I understand the queries, just not the PHP syntax to well yet.

    L

    #2647
    lawrencepepper
    Participant

    Got it to work!

    used this code:


    function mytheme_bulk_options($options)
    {
    mysql_connect('localhost', 'xxx', 'xxx');
    mysql_select_db('qa');
    $query = "SELECT * FROM qa_vendors";

    $result = mysql_query($query);

    $options['Companies'] = array();

    while ($row = mysql_fetch_assoc($result)){
    $options['Companies'][] = $row['company'];
    }
    return $options;
    }
    add_filter('iphorm_bulk_options', 'mytheme_bulk_options');?>

    Thanks!

    L

    #2649
    lawrencepepper
    Participant

    Ok,

    That worked but now that I am using it I did not think this through properly. What I am doing is building a custom web app. I have a form that people fill out, one of the elements is a Company drop down. What I need is for that drop down to dynamically populate itself with all the company names in one of my database tables. There is another form on the site which allows people to add companies to the database. When they do this the dropdown on the other form needs to refelect this without me having to go in to QUFORM and re-configure that drop down box.

    Any possible way of accomplishing this?

    L

    #2651
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #25659
    Sajid Unar
    Participant

    I am trying this with Quform 2 but its not working, as showing blank

    Whats the best way for it

    Thanks

    #25663
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy