Page 1 of 1

Fatal error: Uncaught Error: Call to undefined function mysq

PostPosted: 28. May 2016 17:54
by CoZmicShRedd
Error
Code: Select all
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in G:\xampp\htdocs\cozworld\lgsl\lgsl_files\lgsl_class.php:130 Stack trace: #0 G:\xampp\htdocs\cozworld\lgsl\lgsl_files\lgsl_class.php(308): lgsl_database() #1 G:\xampp\htdocs\cozworld\lgsl\lgsl_files\lgsl_list.php(15): lgsl_query_group() #2 G:\xampp\htdocs\cozworld\lgsl\index.php(33): require('G:\\xampp\\htdocs...') #3 {main} thrown in G:\xampp\htdocs\cozworld\lgsl\lgsl_files\lgsl_class.php on line 130


Need to adjust this so it works with PHP 7 can someone help me fix this coding?

$lgsl_database = mysql_connect($lgsl_config['db']['server'], $lgsl_config['db']['user'], $lgsl_config['db']['pass']) or die(mysql_error());
$lgsl_select_db = mysql_select_db($lgsl_config['db']['db'], $lgsl_database) or die(mysql_error());

Thank you in advance! ;)

Re: Fatal error: Uncaught Error: Call to undefined function

PostPosted: 28. May 2016 18:02
by Nobbie
See https://wiki.php.net/rfc/remove_depreca ... ty_in_php7

The API "mysql" has been removed from PHP7 (it has been declared as "deprecated" in PHP 5.x). Either use "mysqli" API (functions or objects/classes) or use older Xampp with older PHP.

Re: Fatal error: Uncaught Error: Call to undefined function

PostPosted: 29. May 2016 18:10
by CoZmicShRedd
I was mainly asking for coding help that link explains nothing I can understand....

Re: Fatal error: Uncaught Error: Call to undefined function

PostPosted: 29. May 2016 19:37
by Nobbie
CoZmicShRedd wrote:I was mainly asking for coding help


Oh sorry, but this forum is not meant for coding help. It is meant for installation problems instead. Anyway, if you have no skills about programming in PHP, you wont solve this issue. It definately requires advanced PHP programming skills. And its far from the scope of this forum.