<?php $q = $db->query("SELECT `id` FROM `region` WHERE `id_region` = (SELECT MAX(`id_region`) FROM `region`)")->fetch_row(); var_dump($q);