Jump to content

struck with code


EminTugcu

Recommended Posts

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);

 

 

Link to comment
https://forums.phpfreaks.com/topic/114032-struck-with-code/
Share on other sites

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>";
}

Link to comment
https://forums.phpfreaks.com/topic/114032-struck-with-code/#findComment-587886
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.