AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   HLstatsX:CE (https://forums.alliedmods.net/forumdisplay.php?f=156)
-   -   Is this broken with PHP7? (https://forums.alliedmods.net/showthread.php?t=284078)

dungeon 06-18-2016 11:36

Is this broken with PHP7?
 
Trying to do an install using XAMPP which has installed Apache/2.4.18 (Win32), OpenSSL/1.0.2e and PHP/7.0.6.

I'm at the point where I am adding the DB info to the config fie for the website however after I added the info I tried to connect to the site and I get the following errors

Code:

Deprecated:  Methods with the same name as their class will not  be constructors in a future version of PHP; DB_mysql has a deprecated  constructor in D:\xampp\htdocs\hlstatsx\includes\class_db.php on line 58

Deprecated:  Methods with the same name as their class will not  be constructors in a future version of PHP; Table has a deprecated  constructor in D:\xampp\htdocs\hlstatsx\includes\class_table.php on line 48

Deprecated:  Methods with the same name as their class will not  be constructors in a future version of PHP; TableColumn has a deprecated  constructor in D:\xampp\htdocs\hlstatsx\includes\class_table.php on line 515

Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in D:\xampp\htdocs\hlstatsx\includes\class_db.php:87 Stack trace: #0 D:\xampp\htdocs\hlstatsx\hlstats.php(130): DB_mysql->DB_mysql('localhost', '', '', '', 0) #1 {main}  thrown in D:\xampp\htdocs\hlstatsx\includes\class_db.php on line 87

*note i replaced the config file with the blank one so it didn't show all my database info.

Anybody know what is going on here?

melkor217 06-18-2016 12:23

Re: Is this broken with PHP7?
 
Afaik "mysql" module had completely dropped from php7.

Heil mysqli!

melkor217 06-18-2016 12:26

Re: Is this broken with PHP7?
 
http://php.net/manual/en/function.mysql-connect.php

dungeon 06-18-2016 12:32

Re: Is this broken with PHP7?
 
Hmm, so short of learning php and rewriting things my only choice is to go back to php 5.5.

Guess that's not a huge issue.

Thanks all.

Akuba 06-18-2016 15:02

Re: Is this broken with PHP7?
 
why do people still use mysql when mysqli is available?

melkor217 06-18-2016 15:07

Re: Is this broken with PHP7?
 
Quote:

Originally Posted by Akuba (Post 2428611)
why do people still use mysql when mysqli is available?

Because hlstatsx is dead

dungeon 06-18-2016 18:46

Re: Is this broken with PHP7?
 
Went to an older version of xampp, all working now.

XERXES AT 06-28-2016 03:38

Re: Is this broken with PHP7?
 
Had the same problem some time ago, I did compile the "mysql" module for php7, this is not an ideal solution but it works.

Darkimmortal 08-10-2016 14:47

Re: Is this broken with PHP7?
 
https://github.com/kijin/mysql-compat

php.ini auto_prepend_file with this and everything written for the old mysql extension will just work (including HLX:CE)

PAL-18 08-22-2016 00:27

Re: Is this broken with PHP7?
 
Quote:

Originally Posted by Darkimmortal (Post 2443905)
https://github.com/kijin/mysql-compat

php.ini auto_prepend_file with this and everything written for the old mysql extension will just work (including HLX:CE)

I couldn't get that one to work (resulted in blank pages everywhere on my website). I found this one that does the same and does work:

https://sourceforge.net/projects/mysqlwithmysqli

Save file to your stats/include folder.

Edit: include/class_db.php

Below:
Code:

if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.');
Add:
Code:

include 'mysql_mysqli.inc.php';


All times are GMT -4. The time now is 19:45.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.