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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.