Welcome Guest, Not a member yet? Register   Sign In
Using AES_ENCRYPT in model
#3

The set() method you're trying to use is part of the Query Builder, not part of the model itself. The Model provides some magic that allows most of the commands to be intermingled, but you must realize there's still a difference.

In order to get a copy of the Query Builder, at some point you must call $this->builder(), which returns a copy set to the current table, or manually via [b]$this->db->table('x')[\b]. In the first version you're building it manually so it works. The second one the model class doesn't have the knowledge to do it correctly for you.

The best bet is to view the model as full of a bunch of convenience methods, which is what it is. Any query builder methods you use are modifiers to those convenience methods. The model isn't a replacement for the Query Builder.

Hope that helps.
Reply


Messages In This Thread
Using AES_ENCRYPT in model - by tvdp - 10-04-2018, 01:07 PM
RE: Using AES_ENCRYPT in model - by Piotr - 10-04-2018, 05:30 PM
RE: Using AES_ENCRYPT in model - by kilishan - 10-04-2018, 07:51 PM
RE: Using AES_ENCRYPT in model - by tvdp - 10-04-2018, 11:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB