catfan / Medoo

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

Is it possible to do a SELECT with a REGEXP_SUBSTR? #1032

Open novafire99 opened 2 years ago

novafire99 commented 2 years ago

Discussed in https://github.com/catfan/Medoo/discussions/1031

Originally posted by **novafire99** January 9, 2022 Trying to do a select with Medoo, but I want to pass mysql/mariadb "REGEXP_SUBSTR(msg, '[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]')" as one of the items of the select to extract an IP address from the txt record and return just that. Is it possible with Medoo? Works fine when I do it in the sql console. Maybe some way with the raw statement?
novafire99 commented 2 years ago

@catfan Just checking if this is possible?

catfan commented 2 years ago

Yes, it's possible with Raw object. https://medoo.in/api/raw