Help To Make This

Started on the old forum in September 2009 · view the original in the archive · old links redirect here

7 replies · 514 views · started 17 years ago · 1 min read

2 participants
anderson Developer · 146 posts #1

Hi, in forum category page I want to set number(1..2..3..) for every forum category. the action is: index.php?action=viewfrm

Now the page is like:

* Name of a forum
* Name of a forum 
* Nmae of a forum 
......................
......................
* Nmae of a forum 

I want to change it to:

1 Name of a forum
2 Name of a forum
3 Nmae of a forum 
......................
......................
10 Nmae of a forum

Number will be auto increasing.

Coders help me to make it.

Wait...

kiLLeR-eyEd_14 Senior · 382 posts #2

anderson wrote: Hi, in forum category page I want to set number(1..2..3..) for every forum category. the action is: index.php?action=viewfrm

Now the page is like:

* Name of a forum
* Name of a forum 
* Nmae of a forum 
......................
......................
* Nmae of a forum 

I want to change it to:

1 Name of a forum
2 Name of a forum
3 Nmae of a forum 
......................
......................
10 Nmae of a forum

Number will be auto increasing.

Coders help me to make it.

try this:

$items = "SELECT id, name FROM ibwf_fcats ORDER BY position, id";
$sql = mysql_query($items);
$cou = 1;
while($item = mysql_fetch_array($sql))
{
echo "$cou. $item[1]<br/>";
$cou = $cou + 1;
}

try also $cou++..i don't know it much, just try..not sure of this..i just try coding it..coz i think i've done it in our programming course..turbo c..try it and then post here if it worked..don't forget to say thanks..lol =)

anderson Developer · 146 posts #3

Ok mate I will try and if it works i ll must thank u.

Wait...

anderson Developer · 146 posts #5

kiLLeR-eyEd_14 wrote: mate, i just changed the table to be fetched..The $items..I just corrected it..try it..

your code is working for only a page when i go next page it's numbering from 1st again.

Code it now otherwise i wil take back ur thanks!! lol

Wait...

kiLLeR-eyEd_14 Senior · 382 posts #6

anderson wrote: your code is working for only a page when i go next page it's numbering from 1st again.

Code it now otherwise i wil take back ur thanks!! lol

what do you mean?You have another page?It's good for 1 page only..if you want continues number til next page..Include numberings in the topic name..lol..

anderson Developer · 146 posts #7

kiLLeR-eyEd_14 wrote: what do you mean?You have another page?It's good for 1 page only..if you want continues number til next page..Include numberings in the topic name..lol..

I didnt understand ur topic numbering.

suppose there r 40 rows in a table and i want to number that each row order by date and then i want to publish the number previous to a data element. Do u know it's sql or way? @ killer eyed or any

Wait...

anderson Developer · 146 posts #8

Just now I created the code by myself. formula: [(n*x) - {x - (x-1)}]

Wait...

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close