简体   繁体   English

mysql_connect 未定义

[英]mysql_connect not defined

I'm testing a connection to mysql 5.1, with php5 on apache2 (windows).我正在测试与 mysql 5.1 的连接,在 apache2(Windows)上使用 php5。

I have made a regular php test connection page from a tutorial but I'm getting the error "mysql_connect" not defined .我从教程中制作了一个常规的 php 测试连接页面,但我收到错误"mysql_connect" not defined

In eclipse for php, I see the function defined under the language library.在 php 的 eclipse 中,我看到了在语言库下定义的 function。 However when I make a page:但是,当我制作页面时:

<?php
 phpinfo();
?>

I don't see mysql functions or anything there;我没有看到 mysql 功能或任何东西; can someone tell me why?有人能告诉我为什么吗? I thought PHP5 at the least would support MySQL, no?我认为 PHP5 至少会支持 MySQL,不是吗?

The MySQL extension is probably not enabled. MySQL 扩展可能未启用。 If you look through the php.ini file, you should be able to find the appropriate line.如果您查看 php.ini 文件,您应该能够找到相应的行。 phpinfo() will show the location of the php.ini file. phpinfo()将显示 php.ini 文件的位置。

there is php documentation有 php 文档

http://php.net/docs.php http://php.net/docs.php

mysql_connect mysql_connect

http://php.net/manual/en/function.mysql-connect.php http://php.net/manual/en/function.mysql-connect.php

however mysql extension should be enabled in php.ini但是 mysql 扩展应该在 php.ini 中启用

(linux: /etc/apache2/) (Linux:/etc/apache2/)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM