SQL Unbekannter Spaltenfehler mit First () und findAll ()Php

PHP-Programmierer chatten hier
Anonymous
 SQL Unbekannter Spaltenfehler mit First () und findAll ()

Post by Anonymous »

Ich verwende Codesigniter 4 und habe ein Problem mit meinem Modell. Ich verwende First () und findAll (), um Daten als Objekte oder Arrays abzurufen, aber für einige Funktionen erhalte ich diesen Fehler: < /p>

Spalte 'adressis_facturation. Datetime. < /P>

Code: Select all

public function getAdresse(int $idAdresse): ?object
{
return $this->where(['idFacturation' => $idAdresse, 'suppression' => null])->first();
}

< /code>
Mein Modell: < /p>
class AdressesFacturationModel extends Model
{
protected $DBGroup = 'default';
protected $table = 'adresses_facturation'; //Nom de la table
protected $primaryKey = 'idFacturation'; //Clé primaire de la table
protected $useAutoIncrement = true;
protected $returnType = 'object'; // ou array ou object
protected $useSoftDeletes = true;
protected $allowedFields = [
'idFacturation',
'civilite',
'nom',
'prenom',
'entreprise',
'adresse',
'complement',
'postal',
'ville',
'telephone',
'email',
'idPays',
'defaut',
'utilisateurs_idUtilisateur'
];
protected $useTimestamps = true;
protected $createdField = 'creation';
protected $updatedField = 'modification';
protected $deletedField = 'suppression';
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $dateFormat = 'datetime';
< /code>
Im Moment habe ich als Code gemacht: < /p>
    public function getAdresse(int $idAdresse): ?object
{
return $this->where(['idFacturation' => $idAdresse, 'suppression' => null])->get()->getRow();
}
Aber ich würde gerne verstehen, warum ich den Fehler mit dem ersten

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post