Hi there,
i was asked to make little changes to a code not written by...and now i\'m trouble because the code seem rather wier to me and i\'m totally lost.
the piece i\'m having trouble with:
$result = db_s_q(\"*\",\"Toode\",\"WHERE alamk_id=\".$result[0][\'alamk_id\']);
foreach ((array)$result as $value) {
$parem .= \' <a href=\"toode_lisa.php?id=\'.$value[\'id\'].\'\"><span class=\"ptoode\">\'.hs($value[\'mark\']).\"</span></a><br>\".\'<img src=\"./gfx/1x1.gif\" height=\"4\"><br>\'.\"\\n\";
i need the printed result to be alphabetically ordered but i cant figure out how to do it. the table has a lot of coloumns, among them \'mark\' by which i need to order the results.
i tried this
$result = db_s_q(\"*\",\"Toode\",\"WHERE alamk_id=\".$result[0][\'alamk_id\']. \"order by mark\");
but there will be no results. i also tried to \'sort\' the $result but ended with than than sorting it by the first \'id\' coloumn.
hope that somenone can help. but of course there is an option to rewrite everything so that i would understand what where and for what but i though i\'ll first try here.
thank in advance,
veikko