- 論壇徽章:
- 0
|
在某個目錄下通過 /usr/bin/php ./connect.php這種方式執(zhí)行php程序沒問題,但是放在php網(wǎng)頁中,訪問時提示: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;不知是什么問題?網(wǎng)上搜到的方法都試了,就是解決不了,跪求知道大神的給個答案,謝謝!connect.php內(nèi)容如下:
<?php
/**
* @數(shù)據(jù)庫鏈接
*/
$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");
?>
|
|