你好尝试连接到数据库,我不能这样做,我用laragon运行程序并显示此错误。 数据库连接是使用带有mysql的adodb。 感谢帮助。
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADODB_Cache_File has a deprecated constructor in C:\laragon\www\FacturaElectronicaAlumgo\sistema\adodb5\adodb.inc.php on line 233
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADOConnection has a deprecated constructor in C:\laragon\www\FacturaElectronicaAlumgo\sistema\adodb5\adodb.inc.php on line 327
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADORecordSet has a deprecated constructor in C:\laragon\www\FacturaElectronicaAlumgo\sistema\adodb5\adodb.inc.php on line 2854
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADORecordSet_array has a deprecated constructor in C:\laragon\www\FacturaElectronicaAlumgo\sistema\adodb5\adodb.inc.php on line 3872
Fatal error: Uncaught Error: Call to undefined function mysql_pconnect() in C:\laragon\www\FacturaElectronicaAlumgo\sistema\adodb5\drivers\adodb-mysql.inc.php:383 Stack trace: #0 C:\laragon\www\FacturaElectronicaAlumgo\sistema\adodb5\adodb.inc.php(588): ADODB_mysql->_pconnect('localhost', 'root', 'black44265769', 'cal24412_dte') #1 C:\laragon\www\FacturaElectronicaAlumgo\sistema\conexion.php(3): ADOConnection->PConnect('localhost', 'root', 'black44265769', 'cal24412_dte') #2 C:\laragon\www\FacturaElectronicaAlumgo\sistema\validar.php(8): include('C:\\laragon\\www\\...') #3 {main} thrown in C:\laragon\www\FacturaElectronicaAlumgo\sistema\adodb5\drivers\adodb-mysql.inc.php on line 383
答案 0 :(得分:1)
PHP版本是什么?由于“已弃用”,我在这里(可能)假设7.x消息和最后的致命消息错误。
这是两件事......
已弃用:
PHP已更改使用__construct()
(两个前导下划线)作为构造函数,而不是与类本身相同的名称。有关详细信息,请参阅PHP 4 style constructors部分(页面上的第一部分)。
例如:在ADOConnection has a deprecated
constructor...
的文件中,构造函数可能如下所示:
ADOConnection( ... ); // constructors with or without parameters
......但所有这些都可以替换为:
__construct( ... );
您可以在本地进行更改以解决已弃用的消息。
致命错误:
使用PHP 7.x,基于mysql_ *的函数是 除去。请参阅this API info。