Taka sprawa.

Silnik.
  1. /**
  2.   * Get Car attributes given a item id
  3.   *
  4.   * @param int $itemId
  5.   * @return array
  6.   */
  7. public function getCarAttr($itemId)
  8. {
  9. $this->dao->select();
  10. $this->dao->from( $this->getTable_CarAttr());
  11. $this->dao->where('fk_i_item_id', $itemId);
  12.  
  13. $result = $this->dao->get();
  14. if( !$result ) {
  15. return array() ;
  16. }
  17.  
  18. return $result->row();
  19. }


Formularz

  1. <div class="row one_input">
  2. <h6><?php _e('Year', 'cars_attributes'); ?></h6>
  3. <select name="year-min" id="year-min">
  4. <option value=""><?php _e('From', 'cars_attributes'); ?></option>
  5. <?php foreach($years as $y) { ?>
  6. <option value="<?php echo $y['fk_i_item_id']; ?>" <?php if($year==$y['fk_i_item_id']) { echo 'selected'; } ?>><?php echo $y['i_year']; ?></option>
  7. <?php } ?>
  8. </select>
  9. <select name="year-max" id="year-max">
  10. <option value=""><?php _e('To', 'cars_attributes'); ?></option>
  11. <?php foreach($years as $y) { ?>
  12. <option value="<?php echo $y['fk_i_item_id']; ?>" <?php if($year==$y['fk_i_item_id']) { echo 'selected'; } ?>><?php echo $y['i_year']; ?></option>
  13. <?php } ?>
  14. </select>
  15. </div>


i Teraz tak jak sie domyslacie rocznik mam w tabeli CarAttr z id = fk_i_item_id i tabelka i_year

wszystko generalnie nie gra mianowicie zamiast pobierać roczniki wyswietla mi w select "from" i " to" gdzie robie blad??

Rozwiązane


Podsuniecie pomysł jak wcisnąć tu funkje Between?