EminTugcu Posted July 10, 2008 Share Posted July 10, 2008 writing a article lister for mainly Joomla but im struck deeply.. i need to change the $artid dynamicly with actual article id's, which resides in jos_content / id it will be glad if i can get help or guidence, thanks. function makaleler($kim) { global $database; $sql = "SELECT jos_content.title, jos_categories.title AS section FROM jos_content, jos_categories WHERE jos_content.created_by = '$kim' AND jos_content.catid=jos_categories.id"; $database->setQuery( $sql ); $rows = $database->loadObjectList(); foreach ( $rows as $row ) { $artid = ??????????? echo " <a href='index.php?option=com_content&view=article&id=$artid'>$row->title</a>/$row->section<br>"; } } makaleler(65); Quote Link to comment Share on other sites More sharing options...
fenway Posted July 10, 2008 Share Posted July 10, 2008 Change dynamically? What does that mean? Quote Link to comment Share on other sites More sharing options...
EminTugcu Posted July 11, 2008 Author Share Posted July 11, 2008 i mean getting the id for for each article in the "foreach" query Quote Link to comment Share on other sites More sharing options...
fenway Posted July 11, 2008 Share Posted July 11, 2008 Well, you're not getting back jos_content.id... Quote Link to comment Share on other sites More sharing options...
adam84 Posted July 11, 2008 Share Posted July 11, 2008 like this? $sql = "SELECT jos_content.id, jos_content.title, jos_categories.title AS section FROM jos_content, jos_categories WHERE jos_content.created_by = '$kim' AND jos_content.catid=jos_categories.id"; $results = mysql_query( $sql ); while( $row = mysql_fetch_array( $results ) ){ echo " <a href='index.php?option=com_content&view=article&id=".$row['id']."'>".$row['title']."</a>/".$row['section']."<br>"; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.