top 15 ascend and descend code question

This is guide mostly for website tools and code, for example CMS or registration scripts.
There can also be tools.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

top 15 ascend and descend code question

Postby rave on Mon Sep 13, 2010 7:43 am

hello need help can you tell me where is wrong?
heres my code for reborns from highest to lowest
  1. <?PHP
  2. $sql = "SELECT
  3.                 c.reborns as reborns,
  4.                 c.char_name as char_name,
  5.                 c.level as level,
  6.                 c.classid as classid
  7.                 FROM
  8.                 characters as c
  9.               LEFT JOIN
  10.                 accounts as a
  11.               ON
  12.                 (c.account_name = a.username)
  13.               WHERE
  14.                 a.accesslevel < 165
  15.               ORDER BY
  16.                 c.reborns
  17.               DESC
  18.               LIMIT 0,100
  19.               ";


but when i check it at website its not arrange by descending can you please re check where i get it wrong? thanks

the sample is like
characters
a=1
b=2
c=3
d=10
e=100
f=70

it must be
e=100
f=70
d=10
a=1
b=1
c=1

the reborn should be followed not the name T_T

thanks again
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: top 15 ascend and descend code question

Postby Terr0risT on Mon Sep 13, 2010 1:38 pm

are you sure you have the reborn column in your characters table?
User avatar
Terr0risT
Rackie
Rackie
 
Posts: 162
Joined: Sat Aug 11, 2007 10:22 am

Re: top 15 ascend and descend code question

Postby rave on Mon Sep 13, 2010 2:29 pm

yup its in there but what should be it? is it decimal ? var? char? or what im confused on that one thanks

what i mean is when you design table

what should be the type of the reborns? like decimal or something and should i check the box for null?

+

when my old character reborns it records

if i reborn new created characters it doesnt record the reborn

i check the sql the reborn column says (NULL) others are 0 how can i make it recorded thanks
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: top 15 ascend and descend code question

Postby Terr0risT on Mon Sep 13, 2010 3:25 pm

Sorry i'm not really sure how this works.. i never used reborn command in my server.

ANyways, when you say it records the reborns, do you mean the number of times a player is reborn? You may want to put the default to 0 (zero) and not null. and make it an INT. And like i said, i don't have idea of this reborn thing lol.

Why not just call them Born Again.. lol
User avatar
Terr0risT
Rackie
Rackie
 
Posts: 162
Joined: Sat Aug 11, 2007 10:22 am

Re: top 15 ascend and descend code question

Postby rave on Tue Sep 14, 2010 2:37 am

Terr0risT wrote:Sorry i'm not really sure how this works.. i never used reborn command in my server.

ANyways, when you say it records the reborns, do you mean the number of times a player is reborn? You may want to put the default to 0 (zero) and not null. and make it an INT. And like i said, i don't have idea of this reborn thing lol.

Why not just call them Born Again.. lol


i set to int but still its nulled on newly created characters
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: top 15 ascend and descend code question

Postby rave on Wed Sep 15, 2010 11:48 am

fixed thanks to all guys
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm


Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 6 guests