catfan / Medoo

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

Can't use sql function? #389

Closed leeli0 closed 6 years ago

leeli0 commented 8 years ago
protected function fn_quote($column, $string)
    {
        return (strpos($column, '#') === 0 && preg_match('/^[A-Z0-9\_]*\([^)]*\)$/', $string)) ?
            $string :
            $this->quote($string);
    }

Because this function only allow function don't have parameter, so I can't use function like this: ['#store_time[>=]']="SUBDATE(CURDATE(),WEEKDAY(CURDATE()))"

Are you should use this regex: /^[A-Z0-9\_]*\(.*\)$/

catfan commented 6 years ago

Check out the new feature raw object https://medoo.in/api/raw.