Welcome Guest, Not a member yet? Register   Sign In
How to get enum field type value in MySql
#1

How to get enum field possible values from CodeIgniter 4. Any valid SQL instruction passed from $db->query  return empty result. Such instructions working perfectly via MySQL admin area or via MySql admin tool.
Any idea how to implement this?
Thanks.
Reply
#2

Simple:

PHP Code:
// Table ENUM field
`status`    ENUM ('active','inactive'NOT NULL DEFAULT 'active',

// CodeIgniter 4 Builder - Use where
$builder->where('status''active'); 

Try that.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 12-01-2021, 04:49 AM by Kolinski.)

Sorry, but it is not a question of selecting a record that has the active or inactive value, as per your example. But return all possible enum values for the column. In your example, active and inactive. I want to return all possible enum values for the column and not the data. However I already solve this problem whatsoever.
Thanks
Reply
#4

Glad you got it working.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB