Jump to content

[SOLVED] Blog/Articles Sort by Category


luxe

Recommended Posts

Hey guys,

 

Im a total php beginner, so I decided to practice doing a sort of blog site with cms.  The problem I am having specifically is that when I view the articles I've posted, I want to be able to sort them by category using a jump menu I created with the categories populated through the db.

 

Attached are my files including an sql file for the two db's I've linked together.

 

The file in question is located in admin/view_article.php and lines 66-69.

 

I've been stumped on this thing for weeks, and if anyone can figure it out....I'd tell them they were awesome and kiss their ass for the next week or so.

 

[attachment deleted by admin]

Link to comment
Share on other sites

The lines you need to edit are 64-73

they are as follows:

 

mysql_select_db($database_hogAdmin, $hogAdmin);

if ( $myTopic = ""){
$myTopic = "`year` ASC" ;
} else {
$myTopic = "WHERE topic = " . $id_topart;
}


$query_getArticles = "SELECT * FROM blg_article_art INNER JOIN blg_topic_top ON idtop_art=id_top $myTopic ORDER BY" .$myTopic;

 

Let me know if you need some explanation.

 

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.