Showing selected item at top of list


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

I've got a list of names which i am fetching from database like this:
$qry = db_query("SELECT * FROM names");



$i=1;

//prepair list

$html .= '<ul><li>';

while($list = db_fetch_object($qry)){



$html .= '<a>'.$list->name.'</a><div style="height:0px;"></div>';

if($i%6==0){



$html .='</li><li>';

}

$i++;

}

$html .='</li></ul>';

return $html;
Clicking on a name displays its details on next page.
Now my requirement is that i want to display the selected record on next page at the top of the list and rest coming after this record.

I am not getting a way to achieve this!

Please suggest me someway of doing this!
Thanks

No comments posted yet

Your Answer:

Login to answer
301 Like 45 Dislike
Previous forums Next forums
Other forums

Deleting pointers froms vector?
Hi. I have a vector filled with pointers and I want to delete the pointers. I could do a loop and do

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

writing my own sobel filter convolution - something is wrong
I am trying to keep it very simple, I cant see anything wrong with my logic, could anybody help poin

Adding Outlook 2007 items via file upload
I am looking for a way to be able to attach an Outlook item (an email message) in an ASP.NET 3.5 app

Pls help with PHP
Pls can anyone direct me on how to create a user account for a customer. For example i want know if

output printing as hexadecmal... XD
Everything works except the calcem call for the totusold and totuprice. The out put shows up as hex.

PHP File Upload Problem
Hi, I have written a very simple file upload script but it fails for reasons I can't explain. Hope

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

Text file to .Dat file Conversion in PHP
Hi All,
Could anybody provide code for Text file to .Dat file Conversion in PHP.

Tha

explode() function problem maybe
Hi I'm having trouble searching my database. When I type two words in the search field it only searc

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash