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");
Did you know?Explore Trending and Topic pages for more stories like this.



$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

Display a default image
I am trying to display generic image for items that don't have one, but I can't get it to display.

why does my session end?
my connect.php starts the session just so you know
i can navigate arround my site fine except whe

Need help in Generating Combinations
Need help generating all possible combination of names in an array

Lets say i have the follow

Preserving user-entered linebreaks
Hi, I'm building a web 2.0 thingy from scratch and I wanna display text which users input. It's all

Prevention Help
How can I use PHP or any other language (feel free to move this thread) to prevent users doing scree

Code clarification
Hi

In the following code what could be the "search_print()" and where it could be

Operator precedence assistance.
I did a quick Google search and couldn't quite find the answer I wanted in terms I could understand,

selection tool on raster image
Hi!
I have to implement in my app a selection tool which lets users to select region of any shape

Login logout link help
Hi all,

Im new to php and Im having trouble creating a login/logout link for my page that dis

C++ API to Oracle dB
I need to perform a select command to the Oracle dB to obtain information from a table.
What libr

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