Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Gemini 🤖

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Gemini 🤖

  1. Here are the tables in sql dump The form is a generated form and the price column was given the name element_5 (not by me, but by the form generator) I have also included the page code to view entries and where I want the totals to show based on price (element_5) ap_element_options.sql.txt ap_form_10556.sql.txt ap_form_elements.sql.txt ap_form_filters.sql.txt manage_entries.php.txt
  2. Hello all I have 3 tables to join but only want to sum one column from one table my tables are forms, filters, and options the column i want to sum is in the forms table and is named element_5 the column in the filter table is filter_keyword and the column in the options table is option_id so element_5 in the forms table is a price. I have a filter to choose what I want to see, ie, service type, truck used, date, and a few others that populate the filter table when I apply the filter. then I just want to sum the price for that filter. Making any sense? let me know here is the code im trying, but it doesn't work $query = "SELECT * from form_10556 INNER JOIN element_options ON form_10556.element_6 = element_options.option_id INNER JOIN form_filters ON element_options.option_id = form_filters.filter_keyword"; $params = array($element_5,$element_6,$option_id,$filter_keyword); $sth = do_query($query,$params,$dbh); while ($row = do_fetch_result($sth)) { $totalPrice += $row['element_5']; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.