javascript – Undefined method mysqli_result, stuck in this error


I’m trying to learn PHP, AJAX, JS, etc.
I am trying to make a sales system, I am following some tutorial videos step by step, but I am stuck in this error and I am not able to solve on my own.

This is the error that appears to me:

Fatal error: Uncaught Error: Call to undefined method mysqli_result::fetch_objet() in C:\xampp\htdocs\sistema\ajax\categoria.php:45 Stack trace: #0 {main} thrown in C:\xampp\htdocs\sistema\ajax\categoria.php on line 45

This is my code:

    case 'listar':
    $data= Array();

    $results = array(
        "sEcho"=>1, //Information for Datatable
        "iTotalRecords"=>count($data), //send the total records to the datatable
        "iTotalDisplayRecords"=>count($data), // send the total records to the datatable to show
    echo json_encode($results);

My 45 line is: while($reg=$rspta->fetch_objet())

I’m almost sure I wrote it well, I checked it many times

Sorry i don’t have the best english

How to&Answers:

Looks like you misspelt “object”, missing the “c”.

Leave a Reply

Your email address will not be published. Required fields are marked *