Welcome Guest, Not a member yet? Register   Sign In
table name
#2

(02-26-2024, 10:30 AM)Arquero Wrote: I have a model in CI 4.1 than only has a method that do something like 

PHP Code:
public function myfunction() {
  return $this->query('select XXX from XXX where XXX')->getRowArray();


I have updated to CI 4.4.5 and now I must set a table, that does nothing, because I only use ->query. Indeed I can type anything in $this->table cause no real efect.

PHP Code:
public function myfunction() {
  $this->table 'YYY';
  return $this->query('select XXX from XXX where XXX')->getRowArray();


¿Why is needed set table for query? for other methods usage it is ok, but is weird and counter intuitive for only cast a query.

you don't need a model, in your controller just write
PHP Code:
$rows$this->db->query('select xxx from xxx where xxx')->getResult() or $row=$this->db->query('select....')->getRow() 
Reply


Messages In This Thread
table name - by Arquero - 02-26-2024, 10:30 AM
RE: table name - by badger - 02-26-2024, 01:43 PM
RE: table name - by kenjis - 02-26-2024, 04:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB