Hi,
I am a newbie and want to know how can we use the parameters taken from URL or alias of joomla articles:
for e.g
My urls are:
example.com/blue/
example.com/green/
example.com/red/
I am using external database (not joomla) and i have a column which contain fields 'colors'.
I want to give a statement to mysql query :
SELECT *
FROM `table 1`
WHERE Color = 'alias of the current article'
i have tried giving the php code which i use in articles with sources to get the alias or title of joomla article which is:
{source}<?php $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); if ($option=="com_content" && $view=="article") { $idnts = explode(':',JRequest::getString('id')); $myarticle_id = $idnts[0]; $myarticle =& JTable::getInstance("content"); $myarticle->load($myarticle_id); echo $myarticle->get("alias"); } ?>{/source}
I want to use the same output as my field. Kindly help