Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 4 - How to use CAST
#1

(This post was last modified: 10-10-2022, 08:03 PM by paulbalandan.)

Hi, guys!
Simple example to use CAST in CI4 when we need order strings
Considering Query builder.

...   ->orderBy('CAST(table_name AS SIGNED),'ASC')

use SIGNED/UNSIGNED, ASC/DESC according to your needs.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB