I trying to modificate the server start script with no luck.
The connection works fine, i tested, but whenever i try to start the server it's not working
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
function StartServer($id) { $query = mysql_query("SELECT * FROM `cm_servers` WHERE ID = '".mysql_real_escape_string($id)."' LIMIT 1") or die(mysql_error()); 	if(mysql_num_rows($query) == 0) { 		echo "<button class='btn btn-block btn-danger btn-xs'>Server couldn't start.</button><meta http-equiv='refresh' content='3; url=servers.php' /><br />"; 	} else { 		while($srv = mysql_fetch_assoc($query)) 		$connection = ssh2_connect('127.0.0.1', 22); 		ssh2_auth_password($connection, 'user', 'pass'); 		$stream = ssh2_exec($connection, "nohup ./cs2d_dedicated -name '".$srv['name']."' -maxplayers ".$srv['maxplayers']." -port ".$srv['port']." -rcon '".$srv['rcon']."' >/dev/null 2>&1 & echo $! > ./_servers/pid_".$srv['ID'].".pid"); 		} 		echo "<button class='btn btn-block btn-success btn-xs'>Server has been started successfully.</button><meta http-equiv='refresh' content='3; url=servers.php' /><br />"; 	 }
idea?
// please dont tell me use pdo, i will use it, but first i would like to test with mysql.