Rapid query to get a value correspondence

I have a “countries” table: on my script, I have an “id” column value and need its univoque matching “country name” on the same table.
How can I rapidlier do this query on Cake?
Tnx u

Do you know what id you want to search for?

In that case simply doing

$this->Countries->get($id);

will work

Tnx you. I get this error:

Error: countriesHelper could not be found.

Error: Create the class countriesHelper below in file: app\View\Helper\countriesHelper.php

<?php class countriesHelper extends AppHelper { }

I specify: I have this table “countries”, it has some columns (id, name, phonecode, etc). I’ve got an id and want to get his phonecode correspondency.

You cannot access a Table object inside a view/template. You need to fetch the required data in the controller action and pass it to the template.

Make sure you’ve followed the tutorial, it explains all these concepts in detail. https://book.cakephp.org/3.0/en/tutorials-and-examples.html