Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 20

100.43.x.x download
157.55.x.x forum
3.80.x.x forum
35.192.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
54.36.x.x forum
54.36.x.x forum
77.75.x.x user
77.88.x.x forum

Last Seen

85filip58 Tue 15:15
4Rsercom Thu 21:49
Apophis01 Fri 10:15
Bommel Wed 09:39
frob Sat 21:14

Newest Members

Forums
LGSL CRON (Get Players from server and insert in custom column where id=server)
lqlqlq
Sun Nov 10 2013, 05:56PM
Posts: 22
Joined: Fri Apr 29 2011, 11:18AM
Registered Member #6716
Here is my try:

<?php
require "lgsl4/lgsl_files/lgsl_config.php";
$link1  mysql_connect($lgsl_config['db']['server'], $lgsl_config['db']['user'], $lgsl_config['db']['pass']) or die(mysql_error());
require 
"lgsl4/lgsl_files/lgsl_class.php";
$server_list lgsl_query_cached_all("sep");
$server_list lgsl_sort_servers($server_list);

foreach (
$server_list as $server)
{
$i 1;
while (
$i <= $server_list){
$pl $server['s']['players'];
mysql_query("UPDATE lgsl SET h4='$pl'");
}
}


?>


but without success.
any ideas?
Dodgeitorelse
Sun Nov 10 2013, 07:13PM
Posts: 246
Joined: Sun Dec 12 2010, 09:16AM
Registered Member #6457
would seem you have more going on than just this code. What is it you are trying to do? just show the players and no other info?


lack of effort on your part requires less effort on my part
Website
lqlqlq
Mon Nov 11 2013, 05:07AM
Posts: 22
Joined: Fri Apr 29 2011, 11:18AM
Registered Member #6716
Yes, only players.
Dodgeitorelse
Mon Nov 11 2013, 08:44AM
Posts: 246
Joined: Sun Dec 12 2010, 09:16AM
Registered Member #6457
not sure why you want to store all the names in the database. If you are just wanting to store the names how would you expect all the names to go into one cell in your h4 column at each server? there is only one cell per server so if there were 30 players on one server then you would be trying to put all 30 names into that one cell which means you would have to write your code to organize the names into that one cell for example, player1, player2, player3 and so on. if you are just trying to show the current players for all servers then I wouldn't worry about storing them in the database. It sounds to me that you are wanting to just store the names to have a record of all players that ever played on a server. Is this correct?

lack of effort on your part requires less effort on my part
Website
abc123456
Sat May 26 2018, 03:18AM
Posts: 102
Joined: Sat May 26 2018, 03:12AM
Registered Member #8888
[ REQUIRES ADMIN APPROVAL ]
 

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org