ok so i dont know much about sql but im trying to make a dinamic redirect for my website, the idea is to redirect each user to an article called the same as the user is called, so here's a little code but i dont know how to finish it :(
$database->setQuery("SELECT id "." FROM #__content "." WHERE state='1' "." ");
$rows = $database->loadObjectList();
foreach($rows as $user_name){
$article_id = $row->id;
break;
}
$redirect_url = 'index.php?option=com_content&view=article&id='.$article_id;
$user_name and $redirect_url are "premade" options so dont worry about it, i just need to know how to actually do the query hehe, thanks for the help :D