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

调用未定义函数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 有卷积神经网络识别害虫的项目吗
    • ¥15 数据库数据成问号了,前台查询正常,数据库查询是?号
    • ¥15 算法使用了tf-idf,用手肘图确定k值确定不了,第四轮廓系数又太小才有0.006088746097507285,如何解决?(相关搜索:数据处理)
    • ¥15 彩灯控制电路,会的加我QQ1482956179
    • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
    • ¥15 (关键词-电路设计)
    • ¥15 如何解决MIPS计算是否溢出
    • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
    • ¥15 操作系统相关算法中while();的含义
    • ¥15 CNVcaller安装后无法找到文件