Send list item to top
Posted: Tue Apr 13, 2010 7:50 am
I have the following PHP Code which queries a database and generates a list of 4 items.
It works fine and as needed. What I need now is that when I click on a certain item, it moves to the top of the list and the rest remain as they are.
For example it generates:
Nokia
Samsung
Siemens
Motorola
When I lick on Siemens, the list is displayed as follows:
Siemens
Nokia
Samsung
Motorola
Code: Select all
echo'<a href="index.php?id='.$id.'&p='.$row["id"].'"><li style="width:207px; background-color:#bcbec0; color:#ffffff; border:0px; font-weight:bold;" class="mainli">'.$row["pagetitle"].'</li></a>';
$sql2 = "Select * from $table where parent = $row[id] and published = 1 order by menuindex asc";For example it generates:
Nokia
Samsung
Siemens
Motorola
When I lick on Siemens, the list is displayed as follows:
Siemens
Nokia
Samsung
Motorola