普通网友 2018-08-12 18:44
浏览 124
已采纳

尝试使用XAMPP访问我的计算机上的网站时出现PHP致命错误

I have set up a website on my PC with XAMPP, MySQL and Apache enabled. I am getting this fatal error. I have set up the config files and followed the read-me correctly. However I cannot seem to get where the problem is. Database is correctly set up in config files and upload .sql to phpmyadmin.

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\includes\global.php:29 Stack trace: #0 C:\xampp\htdocs\includes\global.php(107): db_connection() #1 C:\xampp\htdocs\admin\index.php(9): include_once('C:\\xampp\\htdocs...') #2 {main} thrown in C:\xampp\htdocs\includes\global.php on line 29

Line 26-33 in global.php

function db_connection()
{
    global $config,$data_sql;
    $data_sql = mysql_connect($config["sql_host"], $config["sql_user"], $config["sql_pass"]);
    if (!$data_sql) die("Can't connect to MySql");
    mysql_select_db($config["db_name"],$data_sql) or die("Can't select database");
}
function db_close()
  • 写回答

2条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥30 在linux上调用海康SDK没有进入函数内
      • ¥15 FreeRTOS有任务卡死
      • ¥15 vue网页地址中的#问题
      • ¥20 一个js里的函数的retur值想返回另一个js的变量值,应该怎么写?
      • ¥15 登陆器jar2exe过期了怎么样重新授权
      • ¥15 我的电脑安装好的PS总是会自己消失,请问这是为什么?
      • ¥15 这个程序哪里有问题呢,显示0分
      • ¥15 我想问一下像图片中这种效果怎么实现
      • ¥20 关于#vue.js#的问题:el-tag拖放到 el-input框时无法完成填充(语言-javascript)
      • ¥15 python小游戏飞机大战空格发射子弹报错,添加旋转代码后陨石一直变大,不知道哪里出错了