codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.39k stars 1.9k forks source link

Bug: getNumRows is undefined #6776

Closed nachtstern3476 closed 2 years ago

nachtstern3476 commented 2 years ago

PHP Version

7.4

CodeIgniter4 Version

4.2.4

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

mysql

What happened?

The intelephense in vscode didn't recognise the getNumRows() method. But the method itself work just fine

Steps to Reproduce

class Testing extends BaseController { 
    public function __construct()
        $this->db = db_connect();
        $table= $this->db->table('example');
        $count = $table->getWhere(['status' => 1])->getNumRows();
    { 
}

in vscode the getNumRows mark as undefined method.

Expected Output

I expect the undefined method will resolve

Anything else?

I knew the problem is in CodeIgniter\Database\ResultInterface the getNumRows() method is not defined there, i want to help add the fix in the code but i don't understand the step to contribute even though i already read the contributing step

kenjis commented 2 years ago

Thank you for reporting. I sent a PR #6778

kenjis commented 2 years ago

i want to help add the fix in the code but i don't understand the step to contribute even though i already read the contributing step

Where don't you understand? https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md

nachtstern3476 commented 2 years ago

Everything, because this is my first time trying to contribute to open source project, i read the contributing guide and it seems there is a lot of word that i don't understand the meaning so i still trying to understand the meaning and hoping that i can understand it in the future. Thanks for helping me

kenjis commented 2 years ago

Okay, we have Forum and Slack to support. https://codeigniter.com/discuss

You don't need to close this issue. It will be closed when the bug fix is merged.