Mysql
 sql >> Base de données >  >> RDS >> Mysql

mysqli fetch() ne récupère pas

C'est assez drôle ce que j'essayais de faire ici. peut-être à cause du surmenage.

Je ne renvoyais rien de cette fonction même si mysqli fecth renvoie true.

donc je modifie l'instruction if($stmt->fetch()){} pour renvoyer un tableau.

if($stmt->fetch()){

        $id =  $this->xss_clean($id);
        $date =  $this->xss_clean($date);
        $name =  $this->xss_clean($name);
        $email =  $this->xss_clean($email);
        $phone =  $this->xss_clean($phone);
        $full_address =  $this->xss_clean($full_address);
        $total_amount_paid =  $this->xss_clean($total_amount_paid);
        $buyers_account_id =  $this->xss_clean($buyers_account_id);
        $sellers_account_id =  $this->xss_clean($sellers_account_id);
        $ad_reference =  $this->xss_clean($ad_reference);
        $transaction_id =  $this->xss_clean($transaction_id);
        $status_by_buyers =  $this->xss_clean($status_by_buyers);
        $status_by_sellers =  $this->xss_clean($status_by_sellers);
        $net_status =  $this->xss_clean($net_status);

        return array(
                $id,
                $date,
                $name,
                $email,
                $phone,
                $full_address,
                $total_amount_paid,
                $buyers_account_id,
                $sellers_account_id,
                $ad_reference,
                $transaction_id,
                $status_by_buyers,
                $status_by_sellers,
                $net_status
                );
    }