CodeIgniter Forums
How to get enum field type value in MySql - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: How to get enum field type value in MySql (/showthread.php?tid=80666)



How to get enum field type value in MySql - Kolinski - 11-29-2021

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.


RE: How to get enum field type value in MySql - InsiteFX - 11-30-2021

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.


RE: How to get enum field type value in MySql - Kolinski - 12-01-2021

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


RE: How to get enum field type value in MySql - InsiteFX - 12-02-2021

Glad you got it working.