Jump to content

Auto numbering


manalnor

Recommended Posts

Hello friends,

 

if i've stored lins in database like this

 

line x

line y

line z

 

so it called from database as $lines

 

then is there something called auto numbering function where is numbering the lines

1- line x

2- line y

3- line z

 

(something)$lines

 

and please don't say why not using $id of each line

cause when i delete the any of the lines for example the second line then it will be

1- line x

3- line z

 

and i wanna show it as

1- line x

2- line z

 

so auto numbering not id ? so is there any function or order by command

 

 

thanks

 

Link to comment
https://forums.phpfreaks.com/topic/197694-auto-numbering/
Share on other sites

it works fine , thanks so much

 

now one last question if i wanna make it shown as number -1

 

for same example

 

1- line x

2- line y

3- line z

 

i wanna make it -1 after 1 so

1- line x

1- line y  (2-1=1)

2- line z  ( 3-1=2)

 

hope you've got the idea

 

thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/197694-auto-numbering/#findComment-1037518
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.