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

need Array help
This is what I have to do.
$teamname[1] = "Red Sox"
$teamname[2] = "Gian

Call Screen statement Error
Dear Experts,

is there any setting that needs to be done before creating any dialog progr

Filling gaps in dates
So i'm doing a query for sales data and my return array looks like this

('date' => '20

help with email script...
hey

I need help with my mail script

when the form on http://www.mcgdesignstudio.com/c

Problem with a select distinct
I have a problema with a select distinct, I have the next sql:

select distinct a,b,c,d fr

Cant display mysql data
Hey all,

I am learning php and my first goal is to create a simple CMS. At the moment I am st

Validation
Hello

I know this is a really vag question.

I need to have a input field on a form th

how can i expire the submitted page using session.
hi,
i'm new to php world.
i'm using "post" method.
when i submit it,data goes to

creating a 1 to 100 in a table
hi guys I am a newb in php need some help.

I have a table with 1 column and 100 rows and in

preg_match logical error
Code: <?php
$s = file_get_contents("page.html");
preg_match('/<div cla

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