Get url using provided SQL SELECT Command

Job ID: 30641713

Budget: $10 – $30 USD

Hello, I am using Joomla with 3rd party extension as content manager. I need to add Previous and Next articles navigation urls inside articles.
$next = "SELECT id, title FROM `#__js_records` WHERE published = 1 AND ctime > '$item->created' ORDER BY ctime ASC LIMIT 1";
$prev = "SELECT id, title FROM `#__js_records` WHERE published = 1 AND ctime < '$item->created' ORDER BY ctime DESC LIMIT 1";

Above code is Select to get table data for both urls from where it should be generated.
As I was told that once I get this data I can create urls using this short code
Потом получить ссылку URL::record($result);

More details will be provided if needed.
Related categories: PHP Joomla SQL MySQL