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

Program with calculate Meteorologic measurements
Hello I'm a beginner and I want to make a program with calculate Meteorologic measurements:
ba

PECL uploadprogress for php5.2
Hey, I just installed PHP5 via .htaccess on my 1and1 Shared Hosting Account.

How would I exac

Output Full URL of Current Page
Let's say I am currently viewing a dynamic page:

http://www.mydomain.com/directory/index.php

Help with lottery style system?
I'm working on a currency system for forums and it is going to have a type of lottery system built i

Strange Oracle Query problem
Ok So I have this PHP class that talks to a Javascript class that basically creates a table of infor

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

IS this code correct
The reason i ask is everything underneath it appears to be alink as well, tis blimmin annoying

Target costs on Process orders not calculating
Hi All,

We have released standard costs for all the materials. We have also done Goods r

Alternate messaging
I have 4 strings in MySQL db1

$string1 : Hello
$string2 : Hi
$string3 : Great
$strin

small inaccuracies
I have this code to convert fractional base 10 into base 2:

while($num > 0)

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