Closed woxiangfy closed 6 years ago
I want to use:ORDER BY rand(); so I edit:
if (isset($where['ORDER'])) { $rsort = '/(^[a-zA-Z0-9-.])(\s_(DESC|ASC))?/'; $ORDER = $where['ORDER'];
if (is_array($ORDER)) { //code.... } else { if ($ORDER == 'rand()') { $where_clause .= ' ORDER BY rand()'; } else { preg_match($rsort, $ORDER, $order_match); $where_clause .= ' ORDER BY "' . str_replace('.', '"."', $order_match[1]) . '"' . (isset($order_match[3]) ? ' ' . $order_match[3] : ''); } }
}
any other solutions?
Check out the new feature raw object https://medoo.in/api/raw.
I want to use:ORDER BY rand(); so I edit:
if (isset($where['ORDER'])) { $rsort = '/(^[a-zA-Z0-9-.])(\s_(DESC|ASC))?/'; $ORDER = $where['ORDER'];
}
any other solutions?