i'm having hard time updating my blog page. i have the same blogs in
my home page for more than 6 months! i tried to change the order of
blogs appearing in my home page by updating the ORDER BY id DESC...
line to ORDER BY user_id or subject or msg and not much has changed. i
changed DESC to ASC but it only switch the blogs but it did not give
me a new posting. please help.

i'm totally new to php & mysql so i posted the code below in case i
might be changing the wrong line. thank you in advance ;)



DB::query("SELECT id, user_id, subject, msg FROM blog_msg WHERE id IN
(" . $g['main_page']['blog1'] . ", " . $g['main_page']['blog2'] . ")
ORDER BY  id  DESC LIMIT 2");
                        while ($row = DB::fetch_row())
                        {
                                $html->setvar("blog_id", $row['id']);
                                $html->setvar("blog_title", 
strip_tags($row['subject']));
                                $html->setvar("blog_msg", 
strip_tags(strlen($row['msg']) > 250 ?
substr($row['msg'], 0, 255) . "..." : $row['msg']));
                                #$blog_name = DB::query("SELECT name FROM user 
WHERE user_id=" .
$row['user_id'] . "", 2);
                                #if (strlen($blog_name) < 3) $blog_name = 
$l['all']['blank'];
                                #$html->setvar("blog_name", $blog_name);
                                if (file_exists($g['path']['dir_main'] . 
"_files/blog/" .
$row['id'] . ".jpg")) $html->parse("blog_image", false);
                                else $html->setblockvar("blog_image", "");
                                $html->parse("blog_item", true);
                        }
                        $html->parse("blogs", true);
                }

                foreach ($g_info as $k => $v) $html->setvar($k, $v);

                $html->setvar("login_message", $this->message);
                parent::parseBlock($html);



Reply via email to