Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
REGXP and CONCAT ORM.
  • I am trying to use this SQL:

    SELECT * FROM `mydata` WHERE `words` REGEXP CONCAT('[',UNHEX('e3'),'-',UNHEX('e9'),']')

    I would like to use the REGXP and CONCAT functions. I would like to use ORM and keep the convenience of relations.

    $f_kanji = Model_Friend::query()
         ->related('user')
         ->related('friend')
         ->related('friend.photo')
         ->where('user.username','REGXP',DB::expr("CONCAT('[',UNHEX('e3'),'-',UNHEX('e9'),']')"))
         ->where('user.username','=',$username)
         ->get();

    I get the error on the part of REGXP ... I was hoping if there is something needed.

    Thanks.

  • What is the exact error?
  • Invalid SQL syntax near REGXP part.
  • Can you post the EXACT error? It includes the SQL generated, and that would help us to see what goes wrong.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion