这项工作:
$position_up = 2;
$rowdata = Subjects::find_by_position($position_up);
echo $rowdata->menu_name; // prints out Equipment..so it works as it echo's well :)
但是这个不起作用它说NULL为什么:
$position_up = 2;
$conditions =array('conditions'=>array('position = ?', $position_up));
$rowdata = Subjects::all($conditions);
var_dump($rowdata->menu_name); //returns NULL ? why ?
答案 0 :(得分:0)
这有效:
$position_up = 2;
$rowdata = Subjects::find_by_position($position_up);
$rowdata->position = $positionactuelle; //UPDATE that previously selected , Assign $positionactuelle
$rowdata->save(); //SAVE :) ...done updating first one.
unset($rowdata);