catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.84k stars 1.15k forks source link

BIG BUG (NOW I FIXED THEM) #461

Closed KiborgMaster closed 8 years ago

KiborgMaster commented 8 years ago

In version 1.1.2 select do not return array values $postData = $this->db->select('v'.PREFIX.'short_posts', ['incr', 'incr_cat'], [ 'AND'=>['incr_cat[=]'=>$viewIncrCats, 'lang'=>$lang, 'status'=>'active'], 'ORDER'=>$_dataCat['order_by'].' '.$_dataCat['order_type'], 'LIMIT'=>[ $bLimit, $eLimit ] ] );

foreach($_postData as $value){ ........ } PHP Error - Warning: Invalid argument supplied for foreach()

In version Medoo 0.9.8.3 its work, please fix this, its vegy big bug, because impossible to use the new version with this BUG

KiborgMaster commented 8 years ago

I found problem in ORDER, if i use Single condition this not work if use Multiple condition all work.

KiborgMaster commented 8 years ago

That's the problem in Single - [ ORDER BY "incr DESC" ] - incorrectly in Multiple - [ ORDER BY "incr" DESC ] - correctly

KiborgMaster commented 8 years ago

Error in string 512 $where_clause .= ' ORDER BY ' . $this->column_quote($ORDER);

My solution $order = explode(' ', $ORDER); $where_clause .= ' ORDER BY "'.$order[0].'" '.$order[1];

catfan commented 8 years ago

There is a new syntax since v1.1.

http://medoo.in/api/where