|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
SitePoint Member
Join Date: Nov 2005
Posts: 6
|
Should be simple, but
Hi all,
I need some help with what should be an easy problem for those in the know. To be honest I have extremely little knowledge of php and usually get by with trial and error. I admin a UK fishing site and require a menu generated from the database to print in the order that the data is entered. http://www.fish4ituk.co.uk/magazine/...zine/index.php On this page the menu is on the left with the last entered topic at the top, i.e. competitions. The first entered topic was Brenig. I need to reverse the way it prints to the page with Brenig being at the top and competition at the bottom. This as far as I’m aware is the code bit that prints the menu. <? $temp = '<tr><td bgcolor="#f0f0f0" width="150" style="padding-left:5px;">· <a href="GROUP_LINK" class="menuSkupina" style="color:black;">GROUP_NAME</a></td></tr>'; $temp .= '<tr><td bgcolor="#999999" height="1"></td></tr>'; ShowNewsGroups(1,0,$temp); ?> Can anyone point me in the right direction? Keep smiling Colin scotland |
|
|
|
|
|
#2 |
|
SitePoint Member
Join Date: Jan 2002
Posts: 12
|
Don't know if I can help you, but the code you provided may display the menu, but "ShowNewsGroups(1,0,$temp)" is a call to a function that displays the menu. You need to post the code for this function for us to be able to help.
Irvin. |
|
|
|
|
|
#3 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Nov 2005
Posts: 328
|
It's a safe bet that the function ShowNewsGroups() has an SQL query in it, unless it's some kind of phpBB-style spaghetti code. What you need to do is find "DESC" in that query and change it to "ASC".
|
|
|
|
|
|
#4 |
|
SitePoint Member
Join Date: Nov 2005
Posts: 6
|
Hi,
Thanks for the help so far. As you will have guessed i know very little about this. Ive read through a php tutorial but I was looking for an answer rather than learning it. i think this is the code that generates the data, this is taken from the admin side of things. <td align="right"><?=_SUBMITEDCATEGORY.": ".$num;?></td> </tr> </table> <form action="<?=$GLOBALS['PHP_SELF'];?>" name="myform" method="post"> <table width="630" cellspacing="2" cellpadding="1" class="MojText"> <tr bgcolor="#<?=_COLOR02;?>"> <td><font color="#<?=_COLOR05;?>"><?=_OPTIONS;?></font></td> <td><font color="#<?=_COLOR05;?>"><?=_NAME;?></font></td> <td><font color="#<?=_COLOR05;?>"><?=_NUMBER;?></font></td> <td><font color="#<?=_COLOR05;?>"><?=_IMAGE;?></font></td> <td><font color="#<?=_COLOR05;?>"><?=_CHECK;?></font></td> </tr> <?php $res = mysql_query("SELECT * from ".$GLOBALS['db_topic']." LIMIT $myopt[0],$myopt[1]"); while ($ar = mysql_fetch_array($res)) { $res2 = mysql_query("SELECT * from ".$GLOBALS['db_news']." where category = $ar[id]"); $num = mysql_num_rows($res2); ?> <tr> <td width="44"> <a href="<?=$GLOBALS['PHP_SELF'];?>?action=edit&id=<?=$ar[id];?>"><img src="gfx/edit.gif" alt="" width="20" height="20" border="0"/></a> <a href="javascript:Confirm('<?=$GLOBALS['PHP_SELF'];?>?action=delete&id=<?=$ar[id];?>','<?=_DELETE.": ".eregi_replace("'","\'",$ar[topictext])."?";?>');"><img src="gfx/trash.gif" width="20" height="20" border="0" alt="" /></a> </td> <td valign="top"><?=$ar[topictext];?></td> <td valign="top"><?=$num;?></td> <td valign="top" width="100"><img height="20" src="<?=$GLOBALS['topic_url']."/".$ar[topicimage];?>" alt="" /></td> <td valign="top" align="center" width="40"><input type="checkbox" name="list[]" value="<?=$ar[id];?>"/></td> </tr> The scripts are from a web magazine thing taken from http://www.skintech.org/webmag/ keep smiling colin scotland |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 15:03.








Hybrid Mode
