Raised This Month: $168 Target: $400
 42% 

Is this broken with PHP7?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dungeon
Senior Member
Join Date: Sep 2009
Old 06-18-2016 , 11:36   Is this broken with PHP7?
Reply With Quote #1

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?

Last edited by dungeon; 06-18-2016 at 11:43.
dungeon is offline
melkor217
Junior Member
Join Date: May 2016
Old 06-18-2016 , 12:23   Re: Is this broken with PHP7?
Reply With Quote #2

Afaik "mysql" module had completely dropped from php7.

Heil mysqli!
melkor217 is offline
melkor217
Junior Member
Join Date: May 2016
Old 06-18-2016 , 12:26   Re: Is this broken with PHP7?
Reply With Quote #3

http://php.net/manual/en/function.mysql-connect.php
melkor217 is offline
dungeon
Senior Member
Join Date: Sep 2009
Old 06-18-2016 , 12:32   Re: Is this broken with PHP7?
Reply With Quote #4

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.
dungeon is offline
Akuba
Senior Member
Join Date: Oct 2013
Old 06-18-2016 , 15:02   Re: Is this broken with PHP7?
Reply With Quote #5

why do people still use mysql when mysqli is available?
Akuba is offline
melkor217
Junior Member
Join Date: May 2016
Old 06-18-2016 , 15:07   Re: Is this broken with PHP7?
Reply With Quote #6

Quote:
Originally Posted by Akuba View Post
why do people still use mysql when mysqli is available?
Because hlstatsx is dead
melkor217 is offline
dungeon
Senior Member
Join Date: Sep 2009
Old 06-18-2016 , 18:46   Re: Is this broken with PHP7?
Reply With Quote #7

Went to an older version of xampp, all working now.
dungeon is offline
XERXES AT
Junior Member
Join Date: Jul 2013
Old 06-28-2016 , 03:38   Re: Is this broken with PHP7?
Reply With Quote #8

Had the same problem some time ago, I did compile the "mysql" module for php7, this is not an ideal solution but it works.
XERXES AT is offline
Darkimmortal
Senior Member
Join Date: Aug 2008
Location: UK
Old 08-10-2016 , 14:47   Re: Is this broken with PHP7?
Reply With Quote #9

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)
__________________
Darkimmortal is offline
PAL-18
AlliedModders Donor
Join Date: Jul 2010
Old 08-22-2016 , 00:27   Re: Is this broken with PHP7?
Reply With Quote #10

Quote:
Originally Posted by Darkimmortal View Post
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';
__________________

Last edited by PAL-18; 08-22-2016 at 00:28.
PAL-18 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin®
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Theme made by Freecode