What’s the relation between them?
-
Question:
How do you declare the relation between this ‘level’:
array('level' => 3, 'url_parameter' => '_year', 'option_title' => __('-- Year --', 'ymm-search'))
And These 2 different columns in the database? :
year_from , year_to
is this line in db.php what builds the relation between them? :
else if ($nextlevel == 3) { $select = "SELECT DISTINCT year_from, year_to FROM {$this->_mainTable} WHERE make = '".esc_sql($params[0])."' AND model = '".esc_sql($params[1])."' AND engine = '".esc_sql($params[2])."' AND (year_from != 0 OR year_to != 0) {$whereProducts}"; $rows = (array) $this->_wpdb->get_results($select, ARRAY_A); $y = array(); foreach ($rows as $r) { $from = (int) $r['year_from']; $to = (int) $r['year_to']; if ($from == 0){ $y[$to] = 1; } elseif ($to == 0){ $y[$from] = 1; } elseif ($from == $to){ $y[$from] = 1; } elseif ($from < $to){ while ($from <= $to){ $y[$from] = 1; $from++; } } } krsort($y); $values = array_keys($y);
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘What’s the relation between them?’ is closed to new replies.