- 论坛徽章:
- 0
|
在某个目录下通过 /usr/bin/php ./connect.php这种方式执行php程序没问题,但是放在php网页中,访问时提示:Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/juve1897/programs/EquipmentInterconnection/html/connect.php:11Stack trace:#0 {main} thrown in /home/juve1897/programs/EquipmentInterconnection/html/connect.php on line 11;不知是什么问题?网上搜到的方法都试了,就是解决不了,跪求知道大神的给个答案,谢谢!connect.php内容如下:
<?php
/**
* @数据库链接
*/
$host="localhost";
$db_user="root";
$db_pass="";
$db_name="demo";
$timezone="Asia/Shanghai";
$link=mysql_connect($host,$db_user,$db_pass);
mysql_select_db($db_name,$link);
mysql_query("SET names UTF8");
header("Content-Type: text/html; charset=utf-8");
?>
|
|