46
Mods & Development / Re: PHP Utilities for PvPGN (Ladder Stats)
« on: April 13, 2015, 04:29:00 PM »
I got it working, its very strange, it looks like i found a bug in the PHP PvPGN Utility:
after looking at /var/log/httpd/error_log
it had a PHP Warning, at mysql_handler.php line 35
So I go look at the mysql_handler php code, and see its trying to connect to "$db_hostname" but the variable used should actually be $db_host
Changed it to $dbhost and now it works.
after looking at /var/log/httpd/error_log
it had a PHP Warning, at mysql_handler.php line 35
So I go look at the mysql_handler php code, and see its trying to connect to "$db_hostname" but the variable used should actually be $db_host
Changed it to $dbhost and now it works.
Code: [Select]
<?php
// ----------------------------------------------------------------------
// Player -vs- Player Gaming Network Statistics System
// http://pvpgn.spfree.net/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
// Author from 2.4.4: Pelish (pelish@gmail.com)
// Original author: jfro (imeepmeep@hotmail.com)
// Author from 2.3.20: Snaiperx (http://www.rino.com.co/)
// Author from 2.3.16: STORM (http://www.stormzone.ru/)
// Tanzania theme author: Tanzania (tanzania@gmx.net)
// ----------------------------------------------------------------------
class sql_handle {
var $db_connection;
// ----------------------------------------------------------------------------------------------
// This is how we connect to DB
// ----------------------------------------------------------------------------------------------
function db_connect([size=14pt][b]$db_hostname,[/b][/size] $db_username, $db_password, $db)
{ global $db_port;
$this->db_connection=mysql_connect($db_hostname.":".$db_port, $db_username, $db_password)
OR die ("Connection Error to Mysql Server");
mysql_select_db($db)
OR die("Connection Error to Database");
return $this->db_connection;
}