Sigh.. i'll see whats going wrong later, gotta go to work.
it should be like this the code..
Code:
public static function highestPortMax(){
self::construct();
$sql = self::$dbh->prepare("select port FROM `". self::$config['db']['userservers'] ."`");
$sql->execute();
if($sql->rowCount() == 0) {
echo "<h3> NO existing ports, you must be the first install using port 9987 </h3>";
$firstInstall = 9987;
return $firstInstall;
}
else{
$sql = self::$dbh->prepare("select MAX(port) as maxPort FROM `". self::$config['db']['userservers'] ."`");
$sql->execute();
$port = $sql->fetch(\PDO::FETCH_ASSOC);
$portMax = $port["maxPort"];
$tester = $portMax + 1;
return $tester;
}
}
some reason its not doing the + 1 for you.