douzhang7184 2016-04-24 11:45
浏览 77

调用未定义函数mysqli_connect(),但函数仍然有效

I'm getting the dreaded:

Fatal Error: Call to undefined function mysqli_connect()

I've read the forums and understand this is typically fixed by turning on the MySQLi extension in php.ini. I have done this.

My concern and my question is that the referenced function works fine. I connect to the database and i'm able to run queries on the database. But keeps throwing this error.

Is it possible that the program is looking at 2 different php.ini files? When I run phpinfo(); it shows the correct php.ini file. If this is the culprit, how can I figure out where this other phantom php.ini file is?

I'm using phpdesigner8 to write and test my code. I have XAMPP and MySQL workbench that I also use on my testing machine. Just curious if this will even matter to the end product. Again everything works fine, even when I put it on my live server. Just don't want this to get in the way on down the road, i'm only about 10% done with the coding and don't want to get 90% and this simple thing be the one thing that crashes the whole program.

Here is my connect file that I'm using:

$server = "xxx.xxx.xxx.xxx:xxxx";
$user = "xxxxxxxx";
$password = "xxxxxxxx";
$database = "xxxxxxxx";

$conn = mysqli_connect($server, $user, $password, $database);

if (!$conn) {
    die("connection failed: " . mysqli_connect_error());
}

Thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?