Jump to content


Photo

Previous and next record


  • Please log in to reply
1 reply to this topic

#1 baber_abbasi

baber_abbasi
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts
  • LocationPakistan

Posted 10 November 2003 - 09:44 PM

I have few values in a field stored in a table. I need to print this field values by loop in a way that it prints like following format;

PREV: A        NEXT: B
PREV: B        NEXT: C
PREV: C        NEXT: D

and so on........

Using following loop format

do {

PREV: $row[\'values\'];
NEXT: $row[\'values\'];
} while()

Plz help me solve this problem.

Thankx in advance.
Baber N Abbasi

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 11 November 2003 - 05:28 AM

do {  

PREV: $row[\'values\'];  
NEXT: $row[\'values\'];  
} while()


I am not really sure if this is what tou ra elooking for :)

do { echo "PREV: ".$row[\'values\']."NEXT:". $row[\'values\']; } while()

Did you mention about having them in a same line?

You can also use sprintf if this didnt work!!
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users