Aegis Support Board: Requesting some ASB scripts. - Aegis Support Board

Jump to content

ASB News! ASB 5.0 Beta V2 has now been released!. See here for more Info.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Requesting some ASB scripts.

#1 User is offline   Riotblade 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 78
  • Joined: 31-May 03

Posted 08 April 2004 - 12:07 AM

Anyone got a script that shows how many registered accounts there are and how many players are on currently? Thanks
0

#2 User is offline   Mana Isozaki 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 147
  • Joined: 23-July 03
  • Location:7th level of hell

Posted 08 April 2004 - 12:13 AM

Its been posted before. Use search.
0

#3 User is offline   Riotblade 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 78
  • Joined: 31-May 03

Posted 12 April 2004 - 03:28 AM

Ugh... I mean *.ASP scripts.
0

#4 User is offline   Mana Isozaki 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 147
  • Joined: 23-July 03
  • Location:7th level of hell

Posted 12 April 2004 - 11:36 PM

Again, been posted. Use search.
0

#5 User is offline   willy_sunny 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 219
  • Joined: 25-June 03
  • Location:Cyberspace
  • Interests:P0rn, girls, s3x, what else? :D

Posted 20 April 2004 - 09:28 PM

lol, poor riot <_<

PS: Why is this thread in this sub forum?
0

#6 User is offline   azndragon 

  • ROCP Creator & SQL God
  • PipPipPipPipPip
  • Group: Members
  • Posts: 475
  • Joined: 15-July 03
  • Location:Brampton, Ontario, Canada

Posted 20 April 2004 - 10:32 PM

From the top of my head, try these code samples. Not sure if the database structure is 100% correct, but it should be relatively easy to fix.

Number of registered accounts:

Quote

<?php
mssql_connect('localhost', 'login', 'tai');
mssql_select_db('nLogin');
$query = "SELECT * FROM login";
$result = mssql_query($query);
$accounts = mssql_num_rows($result);
echo "There are $accounts total accounts on the server.";
?>


Number of online players:

Quote

<?php
mssql_connect('localhost', 'login', 'tai');
mssql_select_db(user);
$query = "SELECT * FROM t_user WHERE tu_state = '1'";
$result = mssql_query($query);
$online = mssql_num_rows($result);
echo "There are $online players online.";
?>

0

#7 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 21 April 2004 - 05:38 AM

@Riotblade

Try this.

@azndragon

He requested ASP, not PHP scripts. ;) Also, concerning the sql you have.. could use just 'SELECT tu_state COUNT(1) FROM t_user' or 'SELECT * COUNT(*) FROM login'. Those I think would just throw back the number of rows where the count condition is true instead of having php need a large array to count the rows from. If mssql doesn't support count I would be somewhat surprised.
0

#8 User is offline   azndragon 

  • ROCP Creator & SQL God
  • PipPipPipPipPip
  • Group: Members
  • Posts: 475
  • Joined: 15-July 03
  • Location:Brampton, Ontario, Canada

Posted 22 April 2004 - 12:28 AM

Didn't read the PHP part, and shouldn't mssql_num_rows work in the same way as you suggestion? The execution time should be very close, not even worth the time it takes to understand the query, cause I never used complex SQL queries :D JOIN was as far as I needed to do what I do.

This post has been edited by azndragon: 22 April 2004 - 12:29 AM

0

#9 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 22 April 2004 - 11:07 AM

Dumb cs classes keep on drilling extreme models to make me code with more efficiency.. try counting the rows of the itemlog table or something, maybe that will sway you over to learning the wonderful joys of sql :D
0

#10 User is offline   azndragon 

  • ROCP Creator & SQL God
  • PipPipPipPipPip
  • Group: Members
  • Posts: 475
  • Joined: 15-July 03
  • Location:Brampton, Ontario, Canada

Posted 22 April 2004 - 12:33 PM

Meh, I'm still new to the PHP/MySQL scene :lol:
0

#11 User is offline   TweaK 

  • Advanced Member
  • PipPipPipPipPip
  • Group: Members
  • Posts: 273
  • Joined: 19-July 03
  • Location:The Netherlands
  • Interests:RO, Beer, Girls, but I DONT have interest in filling this in :P

Posted 22 April 2004 - 06:22 PM

MSSQl :blink:
0

#12 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 23 April 2004 - 07:41 AM

sql is sql is sql.. in general B)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users